File: field_no_name.t

package info (click to toggle)
libhtml-formfu-perl 0.07002-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,928 kB
  • ctags: 989
  • sloc: perl: 12,036; makefile: 9; sql: 5
file content (26 lines) | stat: -rw-r--r-- 467 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use strict;
use warnings;

use Test::More tests => 2 + 1;
use Test::NoWarnings;

use HTML::FormFu;

my $form = HTML::FormFu->new;

$form->element('Text');
$form->element('Text')->name('foo');

my $div = $form->element('Block');
$div->element('Text');
$div->element('Text')->name('bar');

$form->process( { foo => 1 } );

is( @{ $form->get_fields('foo') }, 1 );

{
    my $div = $form->get_element( { type => 'Block' } );

    is( @{ $div->get_fields('bar') }, 1 );
}