QBit/WebInterface/Controller/Form/Field/checkbox.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 23 CC 2 SCAR 12.8
CC
2
Cov
0%
process
6.0
init
2.0
BEGIN
2.0
CRAP 3.6
1 package QBit::WebInterface::Controller::Form::Field::checkbox;
2 $QBit::WebInterface::Controller::Form::Field::checkbox::VERSION = '0.033';
3 use qbit;
4  
5 use base qw(QBit::WebInterface::Controller::Form::Field::input);
6  
7 sub init {
8 my ($self) = @_;
9  
10 $self->SUPER::init();
11  
12 $self->{'input_type'} = 'checkbox';
13 }
14  
15 sub process {
16 my ($self, $controller) = @_;
17  
18 $self->{'checked'} =
19 grep {(defined($self->{'value'}) ? $self->{'value'} : 'on') eq $_}
20 @{$controller->request->param_array($self->{'name'})};
21 }
22  
23 TRUE;