diff --git a/t/Form/CheckList.t b/t/Form/CheckList.t index 3d63df76e..5b502ea4a 100644 --- a/t/Form/CheckList.t +++ b/t/Form/CheckList.t @@ -61,22 +61,22 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed to test basic functionality'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 4, 'The form has 3 inputs'); +is(scalar @inputs, 5, 'The form has 5 inputs'); #Basic tests -is($inputs[0]->name, '__CList1_isIn', 'Checking input name for hidden element'); -is($inputs[0]->type, 'hidden', 'Checking input type for hidden element'); -is($inputs[0]->value, '1', 'Checking default value for hidden element'); -is($inputs[1]->name, 'CList1', 'Checking input name for checkbox 1'); -is($inputs[1]->type, 'checkbox', 'Checking input type for checkbox 1'); -is($inputs[1]->value, 'foo', 'Checking default value for checkbox 1'); -is($inputs[2]->name, 'CList1', 'Checking input name for checkbox 2'); -is($inputs[2]->type, 'checkbox', 'Checking input type for checkbox 2'); -is($inputs[2]->value, undef, 'Checking default value for checkbox 2'); -is($inputs[3]->name, 'CList1', 'Checking input name for checkbox 3'); -is($inputs[3]->type, 'checkbox', 'Checking input type for checkbox 3'); -is($inputs[3]->value, undef, 'Checking default value for checkbox 3'); +is($inputs[1]->name, '__CList1_isIn', 'Checking input name for hidden element'); +is($inputs[1]->type, 'hidden', 'Checking input type for hidden element'); +is($inputs[1]->value, '1', 'Checking default value for hidden element'); +is($inputs[2]->name, 'CList1', 'Checking input name for checkbox 1'); +is($inputs[2]->type, 'checkbox', 'Checking input type for checkbox 1'); +is($inputs[2]->value, 'foo', 'Checking default value for checkbox 1'); +is($inputs[3]->name, 'CList1', 'Checking input name for checkbox 2'); +is($inputs[3]->type, 'checkbox', 'Checking input type for checkbox 2'); +is($inputs[3]->value, undef, 'Checking default value for checkbox 2'); +is($inputs[4]->name, 'CList1', 'Checking input name for checkbox 3'); +is($inputs[4]->type, 'checkbox', 'Checking input type for checkbox 3'); +is($inputs[4]->value, undef, 'Checking default value for checkbox 3'); @@ -95,10 +95,10 @@ my $html = join "\n", is(scalar @forms, 1, '1 form was parsed to test showSelectAll'); @inputs = $forms[0]->inputs; -is(scalar @inputs, 5, 'The form has 5 inputs (1 hidden, 1 button, 3 checkboxes)'); +is(scalar @inputs, 6, 'The form has 6 inputs (CSRF, 1 hidden, 1 button, 3 checkboxes)'); -is($inputs[1]->type, 'button', 'The Select All button is there and before all checkboxes'); -is( $inputs[1]->{value}, +is($inputs[2]->type, 'button', 'The Select All button is there and before all checkboxes'); +is( $inputs[2]->{value}, WebGUI::International->new($session,"Form_CheckList")->get("selectAll label"), 'The value is internationalized' ); diff --git a/t/Form/Checkbox.t b/t/Form/Checkbox.t index 172ca9da6..e2c19d052 100644 --- a/t/Form/Checkbox.t +++ b/t/Form/Checkbox.t @@ -68,11 +68,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 input'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'CBox1', 'Checking input name'); is($input->type, 'checkbox', 'Checking input type'); is($input->value, 'Checkme', 'Checking default value'); diff --git a/t/Form/ClassName.t b/t/Form/ClassName.t index 86af6b924..cb3012185 100644 --- a/t/Form/ClassName.t +++ b/t/Form/ClassName.t @@ -91,11 +91,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 input'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestClass', 'Checking input name'); is($input->type, 'hidden', 'Checking input type'); is($input->value, 'WebGUI::Asset::File', 'Checking default value'); @@ -112,7 +112,7 @@ my $html = join "\n", @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'StorageClass', 'Checking input name'); is($input->value, 'WebGUI::Storage', 'Checking default value'); diff --git a/t/Form/CsrfToken.t b/t/Form/CsrfToken.t index d8972091e..4d67d108a 100644 --- a/t/Form/CsrfToken.t +++ b/t/Form/CsrfToken.t @@ -47,11 +47,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 input'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'webguiCsrfToken', 'Checking input name'); is($input->type, 'hidden', 'Checking input type'); is($input->value, $session->scratch->get('webguiCsrfToken'), 'Checking token value'); diff --git a/t/Form/Date.t b/t/Form/Date.t index 40086ca4f..24003b336 100644 --- a/t/Form/Date.t +++ b/t/Form/Date.t @@ -67,9 +67,9 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestDate', 'Checking input name'); is($input->type, 'text', 'Checking input type'); @@ -95,7 +95,7 @@ $html = join "\n", @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -$input = $inputs[0]; +$input = $inputs[1]; is($input->name, 'preDateValue', 'Checking input name'); TODO: { local $TODO = "Figure out why this is returning a MySQL value instead of an epoch."; diff --git a/t/Form/DateTime.t b/t/Form/DateTime.t index f307a1e71..db2fdfaad 100644 --- a/t/Form/DateTime.t +++ b/t/Form/DateTime.t @@ -51,9 +51,9 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 1 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestDate', 'Checking input name'); is($input->type, 'text', 'Checking input type'); @@ -76,7 +76,7 @@ $html = join "\n", @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -$input = $inputs[0]; +$input = $inputs[1]; is($input->name, 'preDateValue', 'Checking input name'); #is($input->value, 1217608466, 'Checking default value'); is($input->{size}, 19, 'Checking size param, set'); diff --git a/t/Form/Email.t b/t/Form/Email.t index ad1f906aa..0775bb715 100644 --- a/t/Form/Email.t +++ b/t/Form/Email.t @@ -92,11 +92,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestEmail', 'Checking input name'); is($input->type, $formType, 'Checking input type'); is($input->value, 'me@nowhere.com', 'Checking default value'); @@ -115,7 +115,7 @@ $html = join "\n", @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -$input = $inputs[0]; +$input = $inputs[1]; is($input->name, 'email2', 'Checking input name'); is($input->value, 'Some & text in " here', 'Checking default value'); is($input->{size}, 25, 'Checking size param, set'); diff --git a/t/Form/Float.t b/t/Form/Float.t index 5e784d9ad..b6db2dcfb 100644 --- a/t/Form/Float.t +++ b/t/Form/Float.t @@ -110,11 +110,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestFloat', 'Checking input name'); is($input->type, 'text', 'Checking input type'); is($input->value, '12.3456', 'Checking default value'); @@ -133,7 +133,7 @@ my $html = join "\n", @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestFloat2', 'Checking input name'); is($input->value, '00789.25', 'Checking default value'); is($input->{size}, 15, 'set size'); diff --git a/t/Form/Hidden.t b/t/Form/Hidden.t index 890a5ab1d..7675cabd2 100644 --- a/t/Form/Hidden.t +++ b/t/Form/Hidden.t @@ -91,11 +91,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestHidden', 'Checking input name'); is($input->type, 'hidden', 'Checking input type'); is($input->value, 'hiddenData', 'Checking default value'); @@ -112,7 +112,7 @@ $html = join "\n", @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -$input = $inputs[0]; +$input = $inputs[1]; is($input->name, 'hiddenZero', 'Checking input name for zero input'); is($input->value, 0, 'Checking value for zero input'); diff --git a/t/Form/Integer.t b/t/Form/Integer.t index 5dde90699..f563c7403 100644 --- a/t/Form/Integer.t +++ b/t/Form/Integer.t @@ -103,11 +103,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestInteger', 'Checking input name'); is($input->type, 'text', 'Checking input type'); is($input->value, '123456', 'Checking default value'); @@ -128,7 +128,7 @@ my $html = join "\n", @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestInt2', 'Checking input name'); is($input->value, '98765', 'Checking default value'); is($input->{size}, 15, 'set size'); diff --git a/t/Form/Password.t b/t/Form/Password.t index 002a6e211..298770d6b 100644 --- a/t/Form/Password.t +++ b/t/Form/Password.t @@ -67,11 +67,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; use Data::Dumper; is($input->name, 'TestText', 'Checking input name'); is($input->type, $formType, 'Checking input type'); @@ -94,7 +94,7 @@ $html = join "\n", @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -$input = $inputs[0]; +$input = $inputs[1]; is($input->name, 'preTestText', 'Checking input name'); is($input->value, 'Some & text in " here', 'Checking default value'); is($input->{size}, 25, 'Checking size param, set'); diff --git a/t/Form/Phone.t b/t/Form/Phone.t index 96d7bbe7c..cc118f8a9 100644 --- a/t/Form/Phone.t +++ b/t/Form/Phone.t @@ -109,11 +109,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestPhone', 'Checking input name'); is($input->type, 'text', 'Checking input type'); is($input->value, '(555)867-5309', 'Checking default value'); @@ -134,7 +134,7 @@ my $html = join "\n", @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'EuroPhone', 'Checking input name'); is($input->value, '123.456.7890', 'Checking default value'); is($input->{size}, 15, 'set size'); diff --git a/t/Form/Radio.t b/t/Form/Radio.t index abb979f57..22e80b8f0 100644 --- a/t/Form/Radio.t +++ b/t/Form/Radio.t @@ -69,10 +69,10 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'radio1', 'Checking input name'); is($input->type, 'radio', 'Checking input type'); is($input->value, 'Selectify', 'Checking default value'); diff --git a/t/Form/SelectBox.t b/t/Form/SelectBox.t index 96c16a6b4..573c1b97a 100644 --- a/t/Form/SelectBox.t +++ b/t/Form/SelectBox.t @@ -74,7 +74,7 @@ is(scalar @forms, 1, '1 form was parsed'); my $form = $forms[0]; #use Data::Dumper; my @inputs = $form->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests diff --git a/t/Form/SelectList.t b/t/Form/SelectList.t index 8209fb5f4..1303cfacc 100644 --- a/t/Form/SelectList.t +++ b/t/Form/SelectList.t @@ -89,7 +89,7 @@ is(scalar @forms, 1, '1 form was parsed'); my $form = $forms[0]; #use Data::Dumper; my @inputs = $form->inputs; -is(scalar @inputs, 7, 'The form has 7 inputs'); +is(scalar @inputs, 8, 'The form has 8 inputs'); #Basic tests diff --git a/t/Form/Text.t b/t/Form/Text.t index d180c246d..7b4830654 100644 --- a/t/Form/Text.t +++ b/t/Form/Text.t @@ -78,11 +78,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestText', 'Checking input name'); is($input->type, $formType, 'Checking input type'); is($input->value, 'Some text in here', 'Checking default value'); @@ -104,7 +104,7 @@ $html = join "\n", @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -$input = $inputs[0]; +$input = $inputs[1]; is($input->name, 'preTestText', 'Checking input name'); is($input->value, 'Some & text in " here', 'Checking default value'); is($input->{size}, 25, 'Checking size param, set'); diff --git a/t/Form/Textarea.t b/t/Form/Textarea.t index d01e80414..8f4009e69 100644 --- a/t/Form/Textarea.t +++ b/t/Form/Textarea.t @@ -66,11 +66,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestText', 'Checking input name'); is($input->type, $formType, 'Checking input type'); is($input->value, 'Some text in here', 'Checking default value'); @@ -87,7 +87,7 @@ $html = join "\n", @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -$input = $inputs[0]; +$input = $inputs[1]; is($input->name, 'preTestText', 'Checking input name'); is($input->value, 'Some & text in " here', 'Checking default value'); diff --git a/t/Form/Url.t b/t/Form/Url.t index b31cc8189..fc3319406 100644 --- a/t/Form/Url.t +++ b/t/Form/Url.t @@ -96,11 +96,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestUrl', 'Checking input name'); is($input->type, 'text', 'Checking input type'); is($input->value, 'http://www.webgui.org', 'Checking default value'); @@ -122,7 +122,7 @@ $html = join "\n", @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -$input = $inputs[0]; +$input = $inputs[1]; is($input->name, 'preTestUrl', 'Checking input name'); is($input->value, 'http://www.webgui.org?foo=bar&baz=buz', 'Checking default value'); is($input->{size}, 25, 'set size'); diff --git a/t/Form/Zipcode.t b/t/Form/Zipcode.t index c94a82145..8319cc44b 100644 --- a/t/Form/Zipcode.t +++ b/t/Form/Zipcode.t @@ -84,11 +84,11 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); is(scalar @forms, 1, '1 form was parsed'); my @inputs = $forms[0]->inputs; -is(scalar @inputs, 1, 'The form has 1 input'); +is(scalar @inputs, 2, 'The form has 2 inputs'); #Basic tests -my $input = $inputs[0]; +my $input = $inputs[1]; is($input->name, 'TestZip', 'Checking input name'); is($input->type, 'text', 'Checking input type'); is($input->value, '97123-ORST', 'Checking default value'); @@ -107,7 +107,7 @@ $html = join "\n", my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); @inputs = $forms[0]->inputs; -$input = $inputs[0]; +$input = $inputs[1]; is($input->name, 'TestZip2', 'Checking input name'); is($input->type, 'text', 'Checking input type'); is($input->value, '97229-MXIM', 'Checking default value');