File Coverage

blib/lib/CGI/Test/Form/Widget/Box/Check.pm
Criterion Covered Total %
statement 10 11 90.9
branch n/a
condition n/a
subroutine 4 5 80.0
pod 2 2 100.0
total 16 18 88.8


line stmt bran cond sub pod time code
1             package CGI::Test::Form::Widget::Box::Check;
2 14     14   48 use strict;
  14         21  
  14         340  
3 14     14   48 use warnings;
  14         13  
  14         290  
4             ##################################################################
5             # $Id: Check.pm 411 2011-09-26 11:19:30Z nohuhu@nohuhu.org $
6             # $Name: cgi-test_0-104_t1 $
7             ##################################################################
8             #
9             # Copyright (c) 2001, Raphael Manfredi
10             #
11             # You may redistribute only under the terms of the Artistic License,
12             # as specified in the README file that comes with the distribution.
13             #
14              
15             #
16             # This class models a FORM checkbox button.
17             #
18              
19 14     14   39 use base qw(CGI::Test::Form::Widget::Box);
  14         14  
  14         1128  
20              
21             #
22             # Attribute access
23             #
24              
25             sub gui_type
26             {
27 0     0 1 0 return "checkbox";
28             }
29              
30             #
31             # Defined predicates
32             #
33              
34             sub is_radio
35             {
36 16     16 1 36 return 0;
37             }
38              
39             1;
40              
41             =head1 NAME
42              
43             CGI::Test::Form::Widget::Box::Check - A checkbox widget
44              
45             =head1 SYNOPSIS
46              
47             # Inherits from CGI::Test::Form::Widget::Box
48             # $form is a CGI::Test::Form
49              
50             my ($agree, $ads) = $form->checkbox_by_name(qw(i_agree ads));
51              
52             die "expected a standalone checkbox" unless $agree->is_standalone;
53             $agree->check;
54             $ads->uncheck_tagged("spam OK");
55              
56             =head1 DESCRIPTION
57              
58             This class represents a checkbox widget, which may be checked or unchecked
59             at will by users.
60              
61             The interface is the same as the one described
62             in L.
63              
64             =head1 AUTHORS
65              
66             The original author is Raphael Manfredi.
67              
68             Steven Hilton was long time maintainer of this module.
69              
70             Current maintainer is Alexander Tokarev Ftokarev@cpan.orgE>.
71              
72             =head1 SEE ALSO
73              
74             CGI::Test::Form::Widget::Box(3), CGI::Test::Form::Widget::Box::Radio(3).
75              
76             =cut
77