File: radiogroup_id_value.t

package info (click to toggle)
libhtml-formfu-perl 2.07000-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,396 kB
  • sloc: perl: 12,777; makefile: 9; sql: 5
file content (48 lines) | stat: -rw-r--r-- 970 bytes parent folder | download | duplicates (4)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use strict;
use warnings;

use Test::More tests => 1;

use HTML::FormFu;
use lib 't/lib';
use HTMLFormFu::TestLib;

my $form = HTML::FormFu->new(
    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );

$form->id('form')->auto_id('%n_%v');

$form->element('Radiogroup')->name('foo')->values( [qw( a b )] );
$form->element('Radiogroup')->name('foo')->values( [qw( c d )] );

my $form_xhtml = <<XHTML;
<form action="" id="form" method="post">
<fieldset>
<span>
<span>
<input name="foo" type="radio" value="a" id="foo_a" />
<label for="foo_a">A</label>
</span>
<span>
<input name="foo" type="radio" value="b" id="foo_b" />
<label for="foo_b">B</label>
</span>
</span>
</fieldset>
<fieldset>
<span>
<span>
<input name="foo" type="radio" value="c" id="foo_c" />
<label for="foo_c">C</label>
</span>
<span>
<input name="foo" type="radio" value="d" id="foo_d" />
<label for="foo_d">D</label>
</span>
</span>
</fieldset>
</form>
XHTML

is( "$form", $form_xhtml );