more tests for AdSpace and added more POD to AdSpace.pm and Ad.pm
This commit is contained in:
parent
7323ec0c0a
commit
870d9dbe46
3 changed files with 29 additions and 8 deletions
21
t/AdSpace.t
21
t/AdSpace.t
|
|
@ -14,10 +14,10 @@ use lib "$FindBin::Bin/lib";
|
|||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
|
||||
#use Test::More tests => 3;
|
||||
use Test::More;
|
||||
use Test::Deep;
|
||||
|
||||
my $numTests = 4; # increment this value for each test you create
|
||||
my $numTests = 9; # increment this value for each test you create
|
||||
++$numTests; ##For conditional testing on module load
|
||||
|
||||
plan tests => $numTests;
|
||||
|
|
@ -41,6 +41,23 @@ SKIP: {
|
|||
is($data->{name}, $adSpace->get("name"), "get()");
|
||||
is($data->{adSpaceId}, $adSpace->getId, "getId()");
|
||||
|
||||
my $alfred = WebGUI::AdSpace->newByName($session, 'Alfred');
|
||||
|
||||
cmp_deeply($adSpace, $alfred, 'newByName returns identical object if name exists');
|
||||
|
||||
my $bruce = WebGUI::AdSpace->newByName($session, 'Bruce');
|
||||
is($bruce, undef, 'newByName returns undef if the name does not exist');
|
||||
|
||||
my $alfred2 = WebGUI::AdSpace->create($session);
|
||||
is($alfred2, undef, 'create returns undef unless you pass it a name');
|
||||
|
||||
$alfred2 = WebGUI::AdSpace->create($session, {name => 'Alfred'});
|
||||
is($alfred2, undef, 'create returns undef if the name already exists');
|
||||
|
||||
isa_ok($alfred->session, 'WebGUI::Session');
|
||||
|
||||
undef $alfred2;
|
||||
|
||||
}
|
||||
|
||||
END {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue