From dbca5b31d9d8dd01e817a09798c75850773cb931 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sun, 2 May 2010 00:17:03 -0700 Subject: [PATCH] Cleanup more tests that are leaking carts due to address book useId issues. --- t/Shop/PayDriver/Ogone.t | 13 +------------ t/Workflow/Activity/RemoveOldCarts.t | 9 ++++----- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/t/Shop/PayDriver/Ogone.t b/t/Shop/PayDriver/Ogone.t index dc695c70c..c2ed1ee78 100644 --- a/t/Shop/PayDriver/Ogone.t +++ b/t/Shop/PayDriver/Ogone.t @@ -361,6 +361,7 @@ isnt( my $cart = $driver->getCart; isa_ok ($cart, 'WebGUI::Shop::Cart', 'getCart returns an instantiated WebGUI::Shop::Cart object'); +WebGUI::Test->addToCleanup($cart); ####################################################################### # @@ -587,16 +588,4 @@ is ($count, 0, 'delete deleted the object'); undef $driver; - - - -#---------------------------------------------------------------------------- -# Cleanup - - - -} -END { - -} #vim:ft=perl diff --git a/t/Workflow/Activity/RemoveOldCarts.t b/t/Workflow/Activity/RemoveOldCarts.t index 5def4eabf..ec05b6e33 100644 --- a/t/Workflow/Activity/RemoveOldCarts.t +++ b/t/Workflow/Activity/RemoveOldCarts.t @@ -24,6 +24,7 @@ use Test::Deep; plan tests => 6; # increment this value for each test you create my $session = WebGUI::Test->session; +$session->user({userId => 3}); my $root = WebGUI::Asset->getRoot($session); my $donation = $root->addChild({ @@ -38,6 +39,7 @@ WebGUI::Test->tagsToRollback($tag); my $cart1 = WebGUI::Shop::Cart->create($session); my $session2 = WebGUI::Session->open(WebGUI::Test->root, WebGUI::Test->file); +$session2->user({userId => 3}); WebGUI::Test->sessionsToDelete($session2); my $cart2 = WebGUI::Shop::Cart->create($session2); $cart2->update({creationDate => time()-10000}); @@ -81,6 +83,7 @@ my $instance1 = WebGUI::Workflow::Instance->create($session, skipSpectreNotification => 1, } ); +WebGUI::Test->addToCleanup($instance1); my $retVal; @@ -88,7 +91,7 @@ $retVal = $instance1->run(); is($retVal, 'complete', 'cleanup: activity complete'); $retVal = $instance1->run(); is($retVal, 'done', 'cleanup: activity is done'); -$instance1->delete; +$instance1->delete('skipNotify'); @cartIds = $session->db->buildArray('select cartId from cart'); cmp_bag( @@ -103,7 +106,3 @@ cmp_bag( [ $item1->getId, ], 'Deleted 1 item, the correct one' ); - -END { - $instance1->delete('skipNotify'); -}