use strict; use warnings; use Test::More tests => 4; use HTML::Widget; use lib 't/lib'; use HTMLWidget::TestLib; my $w = HTML::Widget->new; $w->element( 'Button', 'foo' )->value('foo')->content('foo'); $w->element( 'Button', 'bar' )->content('')->type('submit'); $w->constraint( 'Integer', 'foo' ); $w->constraint( 'Integer', 'bar' ); # Without query { my $f = $w->process; is( "$f", <
EOF } # With mocked basic query { my $query = HTMLWidget::TestLib->mock_query( { foo => 'yada', bar => '23', } ); my $f = $w->process($query); is( "$f", <
EOF ok( !$f->valid('foo') ); ok( $f->valid('bar') ); }