Cleanup tests that were leaking carts.

This commit is contained in:
Colin Kuskie 2010-05-01 23:54:34 -07:00
parent 884e61aaf6
commit 02c4c5cf47
2 changed files with 4 additions and 17 deletions

View file

@ -22,6 +22,7 @@ use Test::More; # increment this value for each test you create
use Test::Deep; use Test::Deep;
my $session = WebGUI::Test->session; my $session = WebGUI::Test->session;
$session->user({userId => 3});
plan tests => 4; plan tests => 4;

View file

@ -23,6 +23,7 @@ use HTML::Form;
use WebGUI::Test; # Must use this before any other WebGUI modules use WebGUI::Test; # Must use this before any other WebGUI modules
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Shop::PayDriver;
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Init # Init
@ -31,22 +32,13 @@ my $session = WebGUI::Test->session;
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Tests # Tests
my $tests = 54; plan tests => 54;
plan tests => 1 + $tests;
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# figure out if the test can actually run # figure out if the test can actually run
my $e; my $e;
my $loaded = use_ok('WebGUI::Shop::PayDriver');
my $storage;
SKIP: {
skip 'Unable to load module WebGUI::Shop::PayDriver', $tests unless $loaded;
####################################################################### #######################################################################
# #
# definition # definition
@ -255,6 +247,7 @@ isnt(
my $cart = $driver->getCart; my $cart = $driver->getCart;
isa_ok ($cart, 'WebGUI::Shop::Cart', 'getCart returns an instantiated WebGUI::Shop::Cart object'); isa_ok ($cart, 'WebGUI::Shop::Cart', 'getCart returns an instantiated WebGUI::Shop::Cart object');
addToCleanup($cart);
####################################################################### #######################################################################
# #
@ -475,10 +468,3 @@ is ($count, 0, 'delete deleted the object');
undef $driver; undef $driver;
}
#----------------------------------------------------------------------------
# Cleanup
END {
}