From ac77f6f1da27317ff38ca861bff0f86a405cd674 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 14 May 2009 22:18:52 -0700 Subject: [PATCH] Add tagsToRollback to WebGUI::Test --- t/lib/WebGUI/Test.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/t/lib/WebGUI/Test.pm b/t/lib/WebGUI/Test.pm index 1136ed2e3..37216aa4d 100644 --- a/t/lib/WebGUI/Test.pm +++ b/t/lib/WebGUI/Test.pm @@ -55,6 +55,7 @@ my $originalSetting; my @groupsToDelete; my @usersToDelete; my @storagesToDelete; +my @tagsToRollback; BEGIN { @@ -157,6 +158,9 @@ END { $stor->delete; } } + foreach my $tag (@tagsToRollback) { + $tag->rollback; + } if ($ENV{WEBGUI_TEST_DEBUG}) { $Test->diag('Sessions: '.$SESSION->db->quickScalar('select count(*) from userSession')); $Test->diag('Scratch : '.$SESSION->db->quickScalar('select count(*) from userSessionScratch')); @@ -423,6 +427,21 @@ sub storagesToDelete { #---------------------------------------------------------------------------- +=head2 tagsToRollback ( $tag ) + +Push a list of version tags to rollback at the end of the test. + +This is a class method. + +=cut + +sub tagsToRollback { + my $class = shift; + push @tagsToRollback, @_; +} + +#---------------------------------------------------------------------------- + =head2 usersToDelete ( $user, [$user, ...] ) Push a list of user objects onto the stack of groups to be automatically deleted