From a1e85d8b1244b7ab81cec12f6584e1b069f4e204 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 16 Dec 2005 19:37:26 +0000 Subject: [PATCH] add check for Group equivalency with no default selected --- t/FormListEquiv.t | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/t/FormListEquiv.t b/t/FormListEquiv.t index ee9f0808a..346eda40e 100644 --- a/t/FormListEquiv.t +++ b/t/FormListEquiv.t @@ -31,7 +31,7 @@ use Test::More; # increment this value for each test you create # getName set for direct # compare output of toHtml from both objects # compare output of toHtmlWithWrapper from both objects -my $numTests = 8*13; +my $numTests = 8*14; initialize(); # this line is required @@ -205,6 +205,35 @@ is($dynamic->toHtml, $direct->toHtml, "matching Group output, toHtml"); is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching Group output, toHtmlWithWrapper"); is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching Group output, toHtmlAsHidden"); +diag("Group, simple equivalency, no default values"); + +$dynamic = WebGUI::Form::DynamicField->new( + fieldType => 'Group', + name => 'myGroup', + label => 'list of groups', + sortByValue => 1, + value => '', +); +$direct = WebGUI::Form::Group->new({ + name => 'myGroup', + label => 'list of groups', + sortByValue => 1, + value => '', +}); + +#diag("direct" . Dumper($direct)); +#diag("dynamic" . Dumper($dynamic)); + +is(ref $dynamic, "WebGUI::Form::Group", 'checking dynamic Group'); +is(ref $direct, "WebGUI::Form::Group", 'checking direct Group'); +is($direct->getName, WebGUI::International::get('group','WebGUI'), 'Group getName'); +is($dynamic->{sortByValue}, 1, 'dynamic Group was assigned sortByValue'); +is($direct->{sortByValue}, 1, 'direct Group was assigned sortByValue'); +is($dynamic->toHtml, $direct->toHtml, "matching Group output, toHtml"); +is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching Group output, toHtmlWithWrapper"); +is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching Group output, toHtmlAsHidden"); + + diag("TimeZone, simple equivalency"); $dynamic = WebGUI::Form::DynamicField->new(