Updated FormListEquiv.t, all tests pass
fix class method in DatabaseLink.pm fix accessor method in Form/DatabaseLink.pm
This commit is contained in:
parent
e1a90f66fd
commit
6d9ed4b3cd
3 changed files with 75 additions and 58 deletions
|
|
@ -192,6 +192,7 @@ A reference to the current session.
|
|||
=cut
|
||||
|
||||
sub getList {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $list = $session->db->buildHashRef("select databaseLinkId, title from databaseLink order by title");
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ Renders a database connection picker control.
|
|||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
$self->get("options") = WebGUI::DatabaseLink->getList($self->session);
|
||||
$self->set("options", WebGUI::DatabaseLink->getList($self->session));
|
||||
return $self->SUPER::toHtml();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ use lib '../lib';
|
|||
use Getopt::Long;
|
||||
use WebGUI::Form::DynamicField;
|
||||
use WebGUI::Form::SelectList;
|
||||
use WebGUI::Session;
|
||||
use Data::Dumper;
|
||||
# ---- END DO NOT EDIT ----
|
||||
|
||||
|
|
@ -34,6 +35,8 @@ my $numTests = 8*14;
|
|||
|
||||
my $session = initialize(); # this line is required
|
||||
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
|
||||
# put your tests here
|
||||
|
||||
diag("Planning on running $numTests tests\n");
|
||||
|
|
@ -45,6 +48,7 @@ diag("SelectList, simple equivalency with size");
|
|||
my ($direct, $dynamic);
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'SelectList',
|
||||
name => 'mySelectList',
|
||||
label => 'list of selections',
|
||||
|
|
@ -53,7 +57,7 @@ $dynamic = WebGUI::Form::DynamicField->new(
|
|||
sortByValue => 1,
|
||||
multiple => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::SelectList->new({
|
||||
$direct = WebGUI::Form::SelectList->new($session,{
|
||||
name => 'mySelectList',
|
||||
label => 'list of selections',
|
||||
options => { a=>'a', b=>'b', c=>'c', d=>'d', e=>'e', f=>'f', g=>'g', h=>'h', },
|
||||
|
|
@ -64,9 +68,9 @@ $direct = WebGUI::Form::SelectList->new({
|
|||
|
||||
is(ref $dynamic, "WebGUI::Form::SelectList", 'checking dynamic SelectList');
|
||||
is(ref $direct, "WebGUI::Form::SelectList", 'checking direct SelectList');
|
||||
is($direct->getName, WebGUI::International::get('484','WebGUI'), 'Check getName');
|
||||
is($dynamic->{sortByValue}, 1, 'dynamic CheckList was assigned sortByValue');
|
||||
is($direct->{sortByValue}, 1, 'direct CheckList was assigned sortByValue');
|
||||
is($direct->getName($session), $i18n->get('484','WebGUI'), 'Check getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic CheckList was assigned sortByValue');
|
||||
is($direct->get('sortByValue'), 1, 'direct CheckList was assigned sortByValue');
|
||||
is($dynamic->toHtml, $direct->toHtml, "matching output, toHtml");
|
||||
is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching SelectList output, toHtmlWithWrapper");
|
||||
is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching SelectList output, toHtmlAsHidden");
|
||||
|
|
@ -74,6 +78,7 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching SelectList outpu
|
|||
diag("CheckList, simple equivalency");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'CheckList',
|
||||
name => 'myCheckList',
|
||||
label => 'list of selections',
|
||||
|
|
@ -81,7 +86,7 @@ $dynamic = WebGUI::Form::DynamicField->new(
|
|||
value => join("\n", qw(a c e g)),
|
||||
sortByValue => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::CheckList->new({
|
||||
$direct = WebGUI::Form::CheckList->new($session,{
|
||||
name => 'myCheckList',
|
||||
label => 'list of selections',
|
||||
options => { a=>'a', b=>'b', c=>'c', d=>'d', e=>'e', f=>'f', g=>'g', h=>'h', },
|
||||
|
|
@ -91,9 +96,9 @@ $direct = WebGUI::Form::CheckList->new({
|
|||
|
||||
is(ref $dynamic, "WebGUI::Form::CheckList", 'checking dynamic CheckList');
|
||||
is(ref $direct, "WebGUI::Form::CheckList", 'checking direct CheckList');
|
||||
is($direct->getName, WebGUI::International::get('941','WebGUI'), 'Check getName');
|
||||
is($dynamic->{sortByValue}, 1, 'dynamic CheckList was assigned sortByValue');
|
||||
is($direct->{sortByValue}, 1, 'direct CheckList was assigned sortByValue');
|
||||
is($direct->getName($session), $i18n->get('941','WebGUI'), 'Check getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic CheckList was assigned sortByValue');
|
||||
is($direct->get('sortByValue'), 1, 'direct CheckList was assigned sortByValue');
|
||||
is($dynamic->toHtml, $direct->toHtml, "matching CheckList output, toHtml");
|
||||
is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching CheckList output, toHtmlWithWrapper");
|
||||
is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching CheckList output, toHtmlAsHidden");
|
||||
|
|
@ -101,6 +106,7 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching CheckList output
|
|||
diag("RadioList, simple equivalency");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'RadioList',
|
||||
name => 'myRadioList',
|
||||
label => 'list of selections',
|
||||
|
|
@ -108,7 +114,7 @@ $dynamic = WebGUI::Form::DynamicField->new(
|
|||
value => 'b',
|
||||
sortByValue => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::RadioList->new({
|
||||
$direct = WebGUI::Form::RadioList->new($session,{
|
||||
name => 'myRadioList',
|
||||
label => 'list of selections',
|
||||
options => { a=>'a', b=>'b', c=>'c', d=>'d', e=>'e', f=>'f', g=>'g', h=>'h', },
|
||||
|
|
@ -118,9 +124,9 @@ $direct = WebGUI::Form::RadioList->new({
|
|||
|
||||
is(ref $dynamic, "WebGUI::Form::RadioList", 'checking dynamic RadioList');
|
||||
is(ref $direct, "WebGUI::Form::RadioList", 'checking direct RadioList');
|
||||
is($direct->getName, WebGUI::International::get('942','WebGUI'), 'Radio getName');
|
||||
is($dynamic->{sortByValue}, 1, 'dynamic RadioList was assigned sortByValue');
|
||||
is($direct->{sortByValue}, 1, 'direct RadioList was assigned sortByValue');
|
||||
is($direct->getName($session), $i18n->get('942','WebGUI'), 'Radio getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic RadioList was assigned sortByValue');
|
||||
is($direct->get('sortByValue'), 1, 'direct RadioList was assigned sortByValue');
|
||||
is($dynamic->toHtml, $direct->toHtml, "matching RadioList output, toHtml");
|
||||
is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching RadioList output, toHtmlWithWrapper");
|
||||
is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching RadioList output, toHtmlAsHidden");
|
||||
|
|
@ -128,6 +134,7 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching RadioList output
|
|||
diag("SelectBox, simple equivalency");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'SelectBox',
|
||||
name => 'mySelectBox',
|
||||
label => 'list of selections',
|
||||
|
|
@ -135,7 +142,7 @@ $dynamic = WebGUI::Form::DynamicField->new(
|
|||
value => 'b',
|
||||
sortByValue => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::SelectBox->new({
|
||||
$direct = WebGUI::Form::SelectBox->new($session,{
|
||||
name => 'mySelectBox',
|
||||
label => 'list of selections',
|
||||
options => { a=>'a', b=>'b', c=>'c', d=>'d', e=>'e', f=>'f', g=>'g', h=>'h', },
|
||||
|
|
@ -145,9 +152,9 @@ $direct = WebGUI::Form::SelectBox->new({
|
|||
|
||||
is(ref $dynamic, "WebGUI::Form::SelectBox", 'checking dynamic SelectBox');
|
||||
is(ref $direct, "WebGUI::Form::SelectBox", 'checking direct SelectBox');
|
||||
is($direct->getName, WebGUI::International::get('487','WebGUI'), 'SelectBox getName');
|
||||
is($dynamic->{sortByValue}, 1, 'dynamic SelectBox was assigned sortByValue');
|
||||
is($direct->{sortByValue}, 1, 'direct SelectBox was assigned sortByValue');
|
||||
is($direct->getName($session), $i18n->get('487','WebGUI'), 'SelectBox getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic SelectBox was assigned sortByValue');
|
||||
is($direct->get('sortByValue'), 1, 'direct SelectBox was assigned sortByValue');
|
||||
is($dynamic->toHtml, $direct->toHtml, "matching SelectBox output, toHtml");
|
||||
is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching SelectBox output, toHtmlWithWrapper");
|
||||
is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching SelectBox output, toHtmlAsHidden");
|
||||
|
|
@ -155,12 +162,13 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching SelectBox output
|
|||
diag("HiddenList, simple equivalency");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'HiddenList',
|
||||
name => 'myHiddenList',
|
||||
label => 'list of groups',
|
||||
sortByValue => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::HiddenList->new({
|
||||
$direct = WebGUI::Form::HiddenList->new($session,{
|
||||
name => 'myHiddenList',
|
||||
label => 'list of groups',
|
||||
sortByValue => 1,
|
||||
|
|
@ -171,9 +179,9 @@ $direct = WebGUI::Form::HiddenList->new({
|
|||
|
||||
is(ref $dynamic, "WebGUI::Form::HiddenList", 'checking dynamic HiddenList');
|
||||
is(ref $direct, "WebGUI::Form::HiddenList", 'checking direct HiddenList');
|
||||
is($direct->getName, WebGUI::International::get('hidden list','WebGUI'), 'HiddenList getName');
|
||||
is($dynamic->{sortByValue}, 1, 'dynamic HiddenList was assigned sortByValue');
|
||||
is($direct->{sortByValue}, 1, 'direct HiddenList was assigned sortByValue');
|
||||
is($direct->getName($session), $i18n->get('hidden list','WebGUI'), 'HiddenList getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic HiddenList was assigned sortByValue');
|
||||
is($direct->get('sortByValue'), 1, 'direct HiddenList was assigned sortByValue');
|
||||
is($dynamic->toHtml, $direct->toHtml, "matching HiddenList output, toHtml");
|
||||
is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching HiddenList output, toHtmlWithWrapper");
|
||||
is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching HiddenList output, toHtmlAsHidden");
|
||||
|
|
@ -181,12 +189,13 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching HiddenList outpu
|
|||
diag("Group, simple equivalency");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'Group',
|
||||
name => 'myGroup',
|
||||
label => 'list of groups',
|
||||
sortByValue => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::Group->new({
|
||||
$direct = WebGUI::Form::Group->new($session,{
|
||||
name => 'myGroup',
|
||||
label => 'list of groups',
|
||||
sortByValue => 1,
|
||||
|
|
@ -197,9 +206,9 @@ $direct = WebGUI::Form::Group->new({
|
|||
|
||||
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($direct->getName($session), $i18n->get('group','WebGUI'), 'Group getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic Group was assigned sortByValue');
|
||||
is($direct->get('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");
|
||||
|
|
@ -207,13 +216,14 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching Group output, to
|
|||
diag("Group, simple equivalency, no default values");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'Group',
|
||||
name => 'myGroup',
|
||||
label => 'list of groups',
|
||||
sortByValue => 1,
|
||||
value => '',
|
||||
);
|
||||
$direct = WebGUI::Form::Group->new({
|
||||
$direct = WebGUI::Form::Group->new($session,{
|
||||
name => 'myGroup',
|
||||
label => 'list of groups',
|
||||
sortByValue => 1,
|
||||
|
|
@ -225,9 +235,9 @@ $direct = WebGUI::Form::Group->new({
|
|||
|
||||
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($direct->getName($session), $i18n->get('group','WebGUI'), 'Group getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic Group was assigned sortByValue');
|
||||
is($direct->get('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");
|
||||
|
|
@ -236,12 +246,13 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching Group output, to
|
|||
diag("TimeZone, simple equivalency");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'TimeZone',
|
||||
name => 'myTimeZone',
|
||||
label => 'list of time zones',
|
||||
sortByValue => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::TimeZone->new({
|
||||
$direct = WebGUI::Form::TimeZone->new($session,{
|
||||
name => 'myTimeZone',
|
||||
label => 'list of time zones',
|
||||
sortByValue => 1,
|
||||
|
|
@ -252,9 +263,9 @@ $direct = WebGUI::Form::TimeZone->new({
|
|||
|
||||
is(ref $dynamic, "WebGUI::Form::TimeZone", 'checking dynamic TimeZone');
|
||||
is(ref $direct, "WebGUI::Form::TimeZone", 'checking direct TimeZone');
|
||||
is($direct->getName, WebGUI::International::get('timezone','DateTime'), 'TimeZone getName');
|
||||
is($dynamic->{sortByValue}, 1, 'dynamic TimeZone was assigned sortByValue');
|
||||
is($direct->{sortByValue}, 1, 'direct TimeZone was assigned sortByValue');
|
||||
is($direct->getName($session), $i18n->get('timezone','DateTime'), 'TimeZone getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic TimeZone was assigned sortByValue');
|
||||
is($direct->get('sortByValue'), 1, 'direct TimeZone was assigned sortByValue');
|
||||
is($dynamic->toHtml, $direct->toHtml, "matching TimeZone output, toHtml");
|
||||
is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching TimeZone output, toHtmlWithWrapper");
|
||||
is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching TimeZone output, toHtmlAsHidden");
|
||||
|
|
@ -262,12 +273,13 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching TimeZone output,
|
|||
diag("ContentType, simple equivalency");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'ContentType',
|
||||
name => 'myContentType',
|
||||
label => 'list of content types',
|
||||
sortByValue => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::ContentType->new({
|
||||
$direct = WebGUI::Form::ContentType->new($session,{
|
||||
name => 'myContentType',
|
||||
label => 'list of content types',
|
||||
sortByValue => 1,
|
||||
|
|
@ -275,9 +287,9 @@ $direct = WebGUI::Form::ContentType->new({
|
|||
|
||||
is(ref $dynamic, "WebGUI::Form::ContentType", 'checking dynamic ContentType');
|
||||
is(ref $direct, "WebGUI::Form::ContentType", 'checking direct ContentType');
|
||||
is($direct->getName, WebGUI::International::get('1007','WebGUI'), 'ContentType getName');
|
||||
is($dynamic->{sortByValue}, 1, 'dynamic ContentType was assigned sortByValue');
|
||||
is($direct->{sortByValue}, 1, 'direct ContentType was assigned sortByValue');
|
||||
is($direct->getName($session), $i18n->get('1007','WebGUI'), 'ContentType getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic ContentType was assigned sortByValue');
|
||||
is($direct->get('sortByValue'), 1, 'direct ContentType was assigned sortByValue');
|
||||
is($dynamic->toHtml, $direct->toHtml, "matching ContentType output, toHtml");
|
||||
is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching ContentType output, toHtmlWithWrapper");
|
||||
is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching ContentType output, toHtmlAsHidden");
|
||||
|
|
@ -285,12 +297,13 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching ContentType outp
|
|||
diag("FilterContent, simple equivalency");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'FilterContent',
|
||||
name => 'myFilterContent',
|
||||
label => 'list of types to filter',
|
||||
sortByValue => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::FilterContent->new({
|
||||
$direct = WebGUI::Form::FilterContent->new($session,{
|
||||
name => 'myFilterContent',
|
||||
label => 'list of types to filter',
|
||||
sortByValue => 1,
|
||||
|
|
@ -298,9 +311,9 @@ $direct = WebGUI::Form::FilterContent->new({
|
|||
|
||||
is(ref $dynamic, "WebGUI::Form::FilterContent", 'checking dynamic FilterContent');
|
||||
is(ref $direct, "WebGUI::Form::FilterContent", 'checking direct FilterContent');
|
||||
is($direct->getName, WebGUI::International::get('418','WebGUI'), 'FilterContent getName');
|
||||
is($dynamic->{sortByValue}, 1, 'dynamic FilterContent was assigned sortByValue');
|
||||
is($direct->{sortByValue}, 1, 'direct FilterContent was assigned sortByValue');
|
||||
is($direct->getName($session), $i18n->get('418','WebGUI'), 'FilterContent getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic FilterContent was assigned sortByValue');
|
||||
is($direct->get('sortByValue'), 1, 'direct FilterContent was assigned sortByValue');
|
||||
is($dynamic->toHtml, $direct->toHtml, "matching FilterContent output, toHtml");
|
||||
is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching FilterContent output, toHtmlWithWrapper");
|
||||
is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching FilterContent output, toHtmlAsHidden");
|
||||
|
|
@ -308,12 +321,13 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching FilterContent ou
|
|||
diag("LdapLink, simple equivalency");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'LdapLink',
|
||||
name => 'myLdapLink',
|
||||
label => 'list of ldap links',
|
||||
sortByValue => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::LdapLink->new({
|
||||
$direct = WebGUI::Form::LdapLink->new($session,{
|
||||
name => 'myLdapLink',
|
||||
label => 'list of ldap links',
|
||||
sortByValue => 1,
|
||||
|
|
@ -324,9 +338,9 @@ $direct = WebGUI::Form::LdapLink->new({
|
|||
|
||||
is(ref $dynamic, "WebGUI::Form::LdapLink", 'checking dynamic LdapLink');
|
||||
is(ref $direct, "WebGUI::Form::LdapLink", 'checking direct LdapLink');
|
||||
is($direct->getName, WebGUI::International::get("LDAPLink_1075","AuthLDAP"), 'LdapLink getName');
|
||||
is($dynamic->{sortByValue}, 1, 'dynamic LdapLink was assigned sortByValue');
|
||||
is($direct->{sortByValue}, 1, 'direct LdapLink was assigned sortByValue');
|
||||
is($direct->getName($session), $i18n->get("LDAPLink_1075","AuthLDAP"), 'LdapLink getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic LdapLink was assigned sortByValue');
|
||||
is($direct->get('sortByValue'), 1, 'direct LdapLink was assigned sortByValue');
|
||||
is($dynamic->toHtml, $direct->toHtml, "matching LdapLink output, toHtml");
|
||||
is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching LdapLink output, toHtmlWithWrapper");
|
||||
is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching LdapLink output, toHtmlAsHidden");
|
||||
|
|
@ -334,12 +348,13 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching LdapLink output,
|
|||
diag("Template, simple equivalency");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'Template',
|
||||
name => 'myTemplate',
|
||||
label => 'list of ldap links',
|
||||
sortByValue => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::Template->new({
|
||||
$direct = WebGUI::Form::Template->new($session,{
|
||||
name => 'myTemplate',
|
||||
label => 'list of ldap links',
|
||||
sortByValue => 1,
|
||||
|
|
@ -350,9 +365,9 @@ $direct = WebGUI::Form::Template->new({
|
|||
|
||||
is(ref $dynamic, "WebGUI::Form::Template", 'checking dynamic Template');
|
||||
is(ref $direct, "WebGUI::Form::Template", 'checking direct Template');
|
||||
is($direct->getName, WebGUI::International::get("assetName","Asset_Template"), 'Template getName');
|
||||
is($dynamic->{sortByValue}, 1, 'dynamic Template was assigned sortByValue');
|
||||
is($direct->{sortByValue}, 1, 'direct Template was assigned sortByValue');
|
||||
is($direct->getName($session), $i18n->get("assetName","Asset_Template"), 'Template getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic Template was assigned sortByValue');
|
||||
is($direct->get('sortByValue'), 1, 'direct Template was assigned sortByValue');
|
||||
is($dynamic->toHtml, $direct->toHtml, "matching Template output, toHtml");
|
||||
is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching Template output, toHtmlWithWrapper");
|
||||
is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching Template output, toHtmlAsHidden");
|
||||
|
|
@ -360,12 +375,13 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching Template output,
|
|||
diag("WhatNext, simple equivalency");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'WhatNext',
|
||||
name => 'myWhatNext',
|
||||
label => 'list of what to do next',
|
||||
sortByValue => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::WhatNext->new({
|
||||
$direct = WebGUI::Form::WhatNext->new($session,{
|
||||
name => 'myWhatNext',
|
||||
label => 'list of what to do next',
|
||||
sortByValue => 1,
|
||||
|
|
@ -376,9 +392,9 @@ $direct = WebGUI::Form::WhatNext->new({
|
|||
|
||||
is(ref $dynamic, "WebGUI::Form::WhatNext", 'checking dynamic WhatNext');
|
||||
is(ref $direct, "WebGUI::Form::WhatNext", 'checking direct WhatNext');
|
||||
is($direct->getName, WebGUI::International::get('744','WebGUI'), 'WhatNext getName');
|
||||
is($dynamic->{sortByValue}, 1, 'dynamic WhatNext was assigned sortByValue');
|
||||
is($direct->{sortByValue}, 1, 'direct WhatNext was assigned sortByValue');
|
||||
is($direct->getName($session), $i18n->get('744','WebGUI'), 'WhatNext getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic WhatNext was assigned sortByValue');
|
||||
is($direct->get('sortByValue'), 1, 'direct WhatNext was assigned sortByValue');
|
||||
is($dynamic->toHtml, $direct->toHtml, "matching WhatNext output, toHtml");
|
||||
is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching WhatNext output, toHtmlWithWrapper");
|
||||
is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching WhatNext output, toHtmlAsHidden");
|
||||
|
|
@ -386,12 +402,13 @@ is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching WhatNext output,
|
|||
diag("DatabaseLink, simple equivalency");
|
||||
|
||||
$dynamic = WebGUI::Form::DynamicField->new(
|
||||
$session,
|
||||
fieldType => 'DatabaseLink',
|
||||
name => 'myDatabaseLink',
|
||||
label => 'list of databases',
|
||||
sortByValue => 1,
|
||||
);
|
||||
$direct = WebGUI::Form::DatabaseLink->new({
|
||||
$direct = WebGUI::Form::DatabaseLink->new($session,{
|
||||
name => 'myDatabaseLink',
|
||||
label => 'list of databases',
|
||||
sortByValue => 1,
|
||||
|
|
@ -399,15 +416,14 @@ $direct = WebGUI::Form::DatabaseLink->new({
|
|||
|
||||
is(ref $dynamic, "WebGUI::Form::DatabaseLink", 'checking dynamic DatabaseLink');
|
||||
is(ref $direct, "WebGUI::Form::DatabaseLink", 'checking direct DatabaseLink');
|
||||
is($direct->getName, WebGUI::International::get('1075','WebGUI'), 'DatabaseLink getName');
|
||||
is($dynamic->{sortByValue}, 1, 'dynamic DatabaseLink was assigned sortByValue');
|
||||
is($direct->{sortByValue}, 1, 'direct DatabaseLink was assigned sortByValue');
|
||||
is($direct->getName($session), $i18n->get('1075','WebGUI'), 'DatabaseLink getName');
|
||||
is($dynamic->get('sortByValue'), 1, 'dynamic DatabaseLink was assigned sortByValue');
|
||||
is($direct->get('sortByValue'), 1, 'direct DatabaseLink was assigned sortByValue');
|
||||
is($dynamic->toHtml, $direct->toHtml, "matching DatabaseLink output, toHtml");
|
||||
is($dynamic->toHtmlWithWrapper, $direct->toHtmlWithWrapper, "matching DatabaseLink output, toHtmlWithWrapper");
|
||||
is($dynamic->toHtmlAsHidden, $direct->toHtmlAsHidden, "matching DatabaseLink output, toHtmlAsHidden");
|
||||
|
||||
|
||||
|
||||
cleanup($session); # this line is required
|
||||
|
||||
# ---- DO NOT EDIT BELOW THIS LINE -----
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue