From be29a091145ad4c9cd1ce091f13bc0947e4a7f05 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sun, 15 Jun 2008 04:34:48 +0000 Subject: [PATCH] fixes for deleting ship drivers created during testing --- t/Shop/ShipDriver.t | 16 ++++++++-------- t/Shop/ShipDriver/FlatRate.t | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/t/Shop/ShipDriver.t b/t/Shop/ShipDriver.t index 2b06a3931..ba5ca166e 100644 --- a/t/Shop/ShipDriver.t +++ b/t/Shop/ShipDriver.t @@ -31,7 +31,7 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -my $tests = 35; +my $tests = 36; plan tests => 1 + $tests; #---------------------------------------------------------------------------- @@ -341,12 +341,13 @@ cmp_deeply( # ####################################################################### -#$driver->delete; -# -#my $count = $session->db->quickScalar('select count(*) from shipper where shipperId=?',[$driver->shipperId]); -#is($count, 0, 'delete deleted the object'); -# -#undef $driver; +my $driverId = $driver->getId; +$driver->delete; + +my $count = $session->db->quickScalar('select count(*) from shipper where shipperId=?',[$driverId]); +is($count, 0, 'delete deleted the object'); + +undef $driver; } @@ -354,5 +355,4 @@ cmp_deeply( #---------------------------------------------------------------------------- # Cleanup END { - #$session->db->write('delete from shipper'); } diff --git a/t/Shop/ShipDriver/FlatRate.t b/t/Shop/ShipDriver/FlatRate.t index 51ce3d199..20d042f50 100644 --- a/t/Shop/ShipDriver/FlatRate.t +++ b/t/Shop/ShipDriver/FlatRate.t @@ -234,9 +234,10 @@ cmp_deeply( # ####################################################################### +my $driverId = $driver->getId; $driver->delete; -my $count = $session->db->quickScalar('select count(*) from shipper where shipperId=?',[$driver->getId]); +my $count = $session->db->quickScalar('select count(*) from shipper where shipperId=?',[$driverId]); is($count, 0, 'delete deleted the object'); undef $driver;