EMS import/export, Form::*::getValueFromPost(alt_values), and tests

This commit is contained in:
James Tolley 2007-05-29 23:39:24 +00:00
parent 0a7e06edca
commit c09b2cae1b
46 changed files with 1728 additions and 299 deletions

View file

@ -63,7 +63,7 @@ my $testBlock = [
my $formClass = 'WebGUI::Form::Integer';
my $formType = 'Integer';
my $numTests = 11 + scalar @{ $testBlock } + 1;
my $numTests = 11 + scalar @{ $testBlock } + 11;
plan tests => $numTests;
@ -120,3 +120,21 @@ is($input->{maxlength}, 20, 'set maxlength');
WebGUI::Form_Checking::auto_check($session, $formType, $testBlock);
# just testing that getValueFromPost works with an argument
my $int = WebGUI::Form::Integer->new($session);
is($int->getValueFromPost(-123456), -123456, 'getValueFromPost(-123456)');
is($int->getValueFromPost('002300'), '002300', 'getValueFromPost(002300)');
is($int->getValueFromPost('+123456'), 0, 'getValueFromPost(+123456)');
is($int->getValueFromPost('123-456.'), 0, 'getValueFromPost(123-456.)');
is($int->getValueFromPost(123.456), 0, 'getValueFromPost(123.456)');
is($session->form->integer(undef,-123456), -123456, 'session->form->integer(undef,-123456)');
is($session->form->integer(undef,'002300'), '002300', 'session->form->integer(undef,002300)');
is($session->form->integer(undef,'+123456'), 0, 'session->form->integer(undef,+123456)');
is($session->form->integer(undef,'123-456.'), 0, 'session->form->integer(undef,123-456.)');
is($session->form->integer(undef,123.456), 0, 'session->form->integer(undef,123.456)');
__END__