50 lines
1.4 KiB
Perl
50 lines
1.4 KiB
Perl
#-------------------------------------------------------------------
|
|
# WebGUI is Copyright 2001-2006 Plain Black Corporation.
|
|
#-------------------------------------------------------------------
|
|
# Please read the legal notices (docs/legal.txt) and the license
|
|
# (docs/license.txt) that came with this distribution before using
|
|
# this software.
|
|
#-------------------------------------------------------------------
|
|
# http://www.plainblack.com info@plainblack.com
|
|
#-------------------------------------------------------------------
|
|
|
|
use FindBin;
|
|
use strict;
|
|
use lib "$FindBin::Bin/lib";
|
|
use WebGUI::Test;
|
|
use WebGUI::Session;
|
|
|
|
#use Test::More tests => 3;
|
|
use Test::More;
|
|
|
|
my $numTests = 4; # increment this value for each test you create
|
|
++$numTests; ##For conditional testing on module load
|
|
|
|
plan tests => $numTests;
|
|
|
|
my $loaded = use_ok('WebGUI::AdSpace');
|
|
|
|
my $session = WebGUI::Test->session;
|
|
my $adSpace;
|
|
|
|
SKIP: {
|
|
|
|
skip "Unable to load WebGUI::AdSpace", $numTests-1 unless $loaded;
|
|
|
|
$adSpace = WebGUI::AdSpace->create($session, {name=>"Alfred"});
|
|
|
|
isa_ok($adSpace, 'WebGUI::AdSpace');
|
|
|
|
my $data = $session->db->quickHashRef("select adSpaceId, name from adSpace where adSpaceId=?",[$adSpace->getId]);
|
|
|
|
ok(exists $data->{adSpaceId}, "create()");
|
|
is($data->{name}, $adSpace->get("name"), "get()");
|
|
is($data->{adSpaceId}, $adSpace->getId, "getId()");
|
|
|
|
}
|
|
|
|
END {
|
|
if (defined $adSpace and ref $adSpace eq 'WebGUI::AdSpace') {
|
|
$adSpace->delete;
|
|
}
|
|
}
|