use strict; use warnings; use Test::More tests => 10; use HTML::FormFu; my $form = HTML::FormFu->new({ tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } }); my $outer = $form->element('Fieldset')->name('outer')->legend('My Form'); is( $outer->name, 'outer' ); is( $outer->type, 'Fieldset' ); my $inner = $outer->element('Block'); ok( !$inner->name ); is( $inner->type, 'Block' ); my $foo = $outer->element('Text')->name('foo'); is( $foo->name, 'foo' ); is( $foo->type, 'Text' ); my $field_xhtml = qq{
}; is( "$foo", $field_xhtml ); my $inner_xhtml = qq{
}; is( "$inner", $inner_xhtml ); my $outer_xhtml = qq{
My Form $inner_xhtml $field_xhtml
}; is( "$outer", $outer_xhtml ); my $form_xhtml = < $outer_xhtml EOF is( "$form", $form_xhtml );