use strict; use warnings; use Test::More tests => 3; use HTML::Widget; use lib 't/lib'; use HTMLWidget::TestLib; my $w = HTML::Widget->new; $w->element( 'Upload', 'foo' )->label('Foo')->accept('text/plain') ->maxlength(1000)->size(30); $w->element( 'Upload', 'bar' ); $w->constraint( 'Integer', 'foo' ); $w->constraint( 'Integer', 'bar' ); # Without query { my $f = $w->process; ok( $w->enctype() eq 'multipart/form-data', 'enctype automatically set to multipart/form-data' ); is( "$f", <
EOF } # With mocked basic query { my $query = HTMLWidget::TestLib->mock_query( { foo => 'yada', bar => '23', } ); my $f = $w->process($query); is( "$f", <
Invalid Input
EOF }