update to new API
This commit is contained in:
parent
6a9a63c4b0
commit
9dd0ef263a
1 changed files with 7 additions and 7 deletions
|
|
@ -14,6 +14,8 @@ use lib '../lib';
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use WebGUI::Form::FieldType;
|
use WebGUI::Form::FieldType;
|
||||||
use WebGUI::Form::DynamicField;
|
use WebGUI::Form::DynamicField;
|
||||||
|
use WebGUI::Session;
|
||||||
|
use Data::Dumper;
|
||||||
# ---- END DO NOT EDIT ----
|
# ---- END DO NOT EDIT ----
|
||||||
|
|
||||||
#The goal of this test is to verify that getName works with all Form types.
|
#The goal of this test is to verify that getName works with all Form types.
|
||||||
|
|
@ -32,9 +34,7 @@ my $session = initialize(); # this line is required
|
||||||
|
|
||||||
diag("Getting the list of all Form types\n");
|
diag("Getting the list of all Form types\n");
|
||||||
|
|
||||||
my $fieldType = WebGUI::Form::FieldType->new();
|
my @formTypes = sort @{ WebGUI::Form::FieldType->getTypes($session) };
|
||||||
|
|
||||||
my @formTypes = @{ $fieldType->{types} };
|
|
||||||
|
|
||||||
##We have to remove DynamicField from this list, since when you call new
|
##We have to remove DynamicField from this list, since when you call new
|
||||||
##it wants to return a type. We'll check it manually.
|
##it wants to return a type. We'll check it manually.
|
||||||
|
|
@ -45,14 +45,14 @@ plan tests => $numTests;
|
||||||
|
|
||||||
diag("Planning on running $numTests tests\n");
|
diag("Planning on running $numTests tests\n");
|
||||||
|
|
||||||
foreach my $formType (sort @formTypes) {
|
foreach my $formType (@formTypes) {
|
||||||
my $form = WebGUI::Form::DynamicField->new(fieldType => $formType);
|
my $form = WebGUI::Form::DynamicField->new($session, fieldType => $formType);
|
||||||
my $ref = (split /::/, ref $form)[-1];
|
my $ref = (split /::/, ref $form)[-1];
|
||||||
is($ref, $formType, "checking form type $formType");
|
is($ref, $formType, "checking form type $formType");
|
||||||
ok($form->getName, sprintf "form getName = %s", $form->getName);
|
ok($form->getName($session), sprintf "form getName = %s", $form->getName($session));
|
||||||
}
|
}
|
||||||
|
|
||||||
my $name = WebGUI::Form::DynamicField->getName();
|
my $name = WebGUI::Form::DynamicField->getName($session);
|
||||||
|
|
||||||
ok($name, 'did not inherit default form name');
|
ok($name, 'did not inherit default form name');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue