use strict; use warnings; use Test::More tests => 6; use HTML::FormFu; my $form = HTML::FormFu->new({ tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } }); my $foo = $form->element('Checkbox')->name('foo')->value('foox'); # add more elements to test accessor output my $bar = $form->element('Checkbox')->name('bar')->value('barx'); my $moo = $form->element('Checkbox')->name('moo')->value('moox')->default('moox'); my $fad = $form->element('Checkbox')->name('fad')->value('fadx')->default('fadx'); my $field_xhtml = qq{
}; is( "$foo", $field_xhtml, 'field xhtml' ); my $form_xhtml = < $field_xhtml
EOF is( "$form", $form_xhtml, 'stringified form' ); # With mocked basic query { $form->process( { foo => 'foox', moo => 'moox', } ); like( "$foo", qr/checked/ ); unlike( "$bar", qr/checked/ ); like( "$moo", qr/checked/ ); unlike( "$fad", qr/checked/ ); }