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( 'Submit', 'foo' )->value('foo'); $w->element( 'Submit', 'bar' ); $w->element( 'Submit', 'foobar' )->src('http://localhost/test.jpg'); $w->element( 'Submit', 'foo1' )->src('test.jpg')->height(10); $w->element( 'Submit', 'foo2' )->src('test.jpg')->width(10); $w->element( 'Submit', 'foo3' )->src('test.jpg')->height(10)->width(20); $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') ); }