From b832deecd194b1a7cb6c61030375b44a2ecec2d6 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 10 Jun 2010 08:59:18 -0500 Subject: [PATCH] convert all cleanup methods to addToCleanup --- t/AdSpace/Ad.t | 2 +- t/Asset/AssetClipboard.t | 6 +- t/Asset/AssetExportHtml.t | 4 +- t/Asset/AssetLineage.t | 6 +- t/Asset/AssetPackage.t | 8 +- t/Asset/AssetTrash.t | 2 +- t/Asset/AssetVersion.t | 4 +- t/Asset/EMSSubmissionForm.t | 16 +-- t/Asset/Event.t | 6 +- t/Asset/Event/edit.t | 2 +- t/Asset/Event/permissions.t | 2 +- t/Asset/File/GalleryFile/Photo/edit.t | 2 +- t/Asset/File/GalleryFile/Photo/permissions.t | 6 +- t/Asset/Post.t | 6 +- t/Asset/Post/Thread/permission.t | 4 +- t/Asset/Post/permission.t | 4 +- t/Asset/Redirect/mech.t | 2 +- t/Asset/Shortcut/010-linked-asset.t | 2 +- t/Asset/Sku/Product.t | 10 +- t/Asset/Sku/Subscription.t | 6 +- t/Asset/Story.t | 10 +- t/Asset/Template.t | 2 +- t/Asset/Template/packed.t | 2 +- t/Asset/WikiPage.t | 2 +- t/Asset/WikiPage/subscribable.t | 2 +- t/Asset/Wobject/Article.t | 4 +- t/Asset/Wobject/Collaboration/permission.t | 2 +- t/Asset/Wobject/Collaboration/unarchiveAll.t | 2 +- t/Asset/Wobject/DataForm.t | 2 +- t/Asset/Wobject/EventManagementSystem.t | 6 +- t/Asset/Wobject/Gallery/permission.t | 4 +- t/Asset/Wobject/GalleryAlbum/ajax.t | 4 +- t/Asset/Wobject/GalleryAlbum/edit.t | 4 +- t/Asset/Wobject/GalleryAlbum/permission.t | 2 +- t/Asset/Wobject/GalleryAlbum/rss.t | 2 +- t/Asset/Wobject/InOutBoard.t | 4 +- t/Asset/Wobject/Matrix.t | 4 +- t/Asset/Wobject/Poll.t | 2 +- t/Asset/Wobject/Shelf.t | 10 +- t/Asset/Wobject/StoryArchive.t | 16 +-- t/Asset/Wobject/StoryTopic.t | 2 +- t/Asset/Wobject/Survey.t | 6 +- t/Asset/Wobject/Survey/ExpressionEngine.t | 4 +- t/Asset/Wobject/Survey/Reports.t | 2 +- t/Asset/Wobject/Survey/Test.t | 2 +- t/Asset/Wobject/Thingy.t | 4 +- t/Asset/Wobject/WikiMaster/featured.t | 2 +- t/Asset/Wobject/WikiMaster/subscribable.t | 2 +- t/AssetAspect/RssFeed.t | 4 +- t/Auth/mech.t | 4 +- t/FilePump/Bundle.t | 4 +- t/Group.t | 38 +++--- t/Group/resetGroupFields.t | 10 +- t/Inbox.t | 2 +- t/Inbox/Groups.t | 6 +- t/Keyword.t | 2 +- t/Macro.t | 2 +- t/Macro/FilePump.t | 4 +- t/Macro/FileUrl.t | 2 +- t/Macro/Include.t | 2 +- t/Macro/Thumbnail.t | 2 +- t/Macro/User.t | 2 +- t/Mail/Send.t | 8 +- t/ProfileField.t | 2 +- t/Search.t | 2 +- t/Search/Index.t | 2 +- t/Session.t | 2 +- t/Session/DateTime.t | 4 +- t/Session/ErrorHandler.t | 2 +- t/Shop/AddressBook.t | 2 +- t/Shop/Cart.t | 2 +- t/Shop/PayDriver/ITransact.t | 2 +- t/Shop/ShipDriver/UPS.t | 2 +- t/Shop/ShipDriver/USPS.t | 2 +- t/Shop/ShipDriver/USPSInternational.t | 2 +- t/Shop/TaxDriver/EU.t | 2 +- t/Shop/Vendor.t | 2 +- t/Storage/Image.t | 10 +- t/User.t | 26 ++-- t/VersionTag.t | 6 +- t/Workflow/Activity/CalendarUpdateFeeds.t | 2 +- .../ExpireIncompleteSurveyResponses.t | 10 +- t/Workflow/Activity/RemoveOldCarts.t | 4 +- t/Workflow/Activity/SendNewsletters.t | 4 +- t/Workflow/Activity/TrashExpiredEvents.t | 2 +- t/lib/WebGUI/Test.pm | 117 ------------------ 86 files changed, 198 insertions(+), 315 deletions(-) diff --git a/t/AdSpace/Ad.t b/t/AdSpace/Ad.t index 71f167e0b..3ceead543 100644 --- a/t/AdSpace/Ad.t +++ b/t/AdSpace/Ad.t @@ -48,7 +48,7 @@ my $session = WebGUI::Test->session; my $ad; my ($richAd, $textAd, $imageAd, $nonAd, $setAd); my $imageStorage = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($imageStorage); +WebGUI::Test->addToCleanup($imageStorage); $imageStorage->addFileFromScalar('foo.bmp', 'This is not really an image'); diff --git a/t/Asset/AssetClipboard.t b/t/Asset/AssetClipboard.t index 69c3752d5..d996279c9 100644 --- a/t/Asset/AssetClipboard.t +++ b/t/Asset/AssetClipboard.t @@ -29,7 +29,7 @@ $session->user({userId => 3}); my $root = WebGUI::Asset->getRoot($session); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Asset Clipboard test"}); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my $snippet = $root->addChild({ url => 'testSnippet', @@ -86,7 +86,7 @@ is($duplicatedSnippet->getParent->getId, $root->getId, 'duplicated snippet is al my $newVersionTag = WebGUI::VersionTag->getWorking($session); $newVersionTag->commit; -WebGUI::Test->tagsToRollback($newVersionTag); +WebGUI::Test->addToCleanup($newVersionTag); #################################################### # @@ -131,7 +131,7 @@ sub is_tree_of_folders { # test www_copy my $tag = WebGUI::VersionTag->create($session); $tag->setWorking; -WebGUI::Test->tagsToRollback($tag); +WebGUI::Test->addToCleanup($tag); my $tempspace = WebGUI::Asset->getTempspace($session); my $folder = {className => 'WebGUI::Asset::Wobject::Folder'}; diff --git a/t/Asset/AssetExportHtml.t b/t/Asset/AssetExportHtml.t index 6445786fb..1fe9bed6a 100644 --- a/t/Asset/AssetExportHtml.t +++ b/t/Asset/AssetExportHtml.t @@ -289,7 +289,7 @@ is($gcAsPath->absolute($exportPath)->stringify, $litmus->absolute($exportPath)-> # now let's get tricky and test different file extensions my $storage = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($storage->getId); +WebGUI::Test->addToCleanup($storage); my $filename = 'somePerlFile_pl.txt'; $storage->addFileFromScalar($filename, $filename); $session->user({userId=>3}); @@ -322,7 +322,7 @@ is($fileAsPath->absolute($exportPath)->stringify, $litmus->absolute($exportPath) # test a different extension, the .foobar extension $storage = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($storage->getId); +WebGUI::Test->addToCleanup($storage); $filename = 'someFoobarFile.foobar'; $storage->addFileFromScalar($filename, $filename); $properties = { diff --git a/t/Asset/AssetLineage.t b/t/Asset/AssetLineage.t index 531d82d7a..e13a818b0 100644 --- a/t/Asset/AssetLineage.t +++ b/t/Asset/AssetLineage.t @@ -30,7 +30,7 @@ is($asset->formatRank(76), "000076", "formatRank()"); is($asset->getLineageLength(), (length($asset->get("lineage")) / 6), "getLineageLength()"); my $versionTag = WebGUI::VersionTag->getWorking($session); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); $versionTag->set({name=>"AssetLineage Test"}); my $root = WebGUI::Asset->getRoot($session); @@ -58,7 +58,7 @@ my $folder2 = $topFolder->addChild({ }); my $editor = WebGUI::User->new($session, 'new'); -WebGUI::Test->usersToDelete($editor); +WebGUI::Test->addToCleanup($editor); $editor->addToGroups([4]); my @snippets = (); @@ -528,7 +528,7 @@ cmp_bag( my $vTag2 = WebGUI::VersionTag->getWorking($session); $vTag2->set({name=>"deep addChild test"}); -WebGUI::Test->tagsToRollback($vTag2); +WebGUI::Test->addToCleanup($vTag2); WebGUI::Test->interceptLogging(); diff --git a/t/Asset/AssetPackage.t b/t/Asset/AssetPackage.t index c6b95cfd1..8d6c4ac10 100644 --- a/t/Asset/AssetPackage.t +++ b/t/Asset/AssetPackage.t @@ -32,7 +32,7 @@ my $root = WebGUI::Asset->getRoot($session); is(scalar @{ $root->getPackageList }, 0, 'WebGUI does not ship with packages'); my $versionTag = WebGUI::VersionTag->getWorking($session); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); $versionTag->set({name=>"Asset Package test"}); my $folder = $root->addChild({ @@ -86,7 +86,7 @@ cmp_ok( $snippetRev->get('revisionDate'), '>', $snippet->get('revisionDate'), '. my $vt2 = WebGUI::VersionTag->getWorking($session); $vt2->commit; -WebGUI::Test->tagsToRollback($vt2); +WebGUI::Test->addToCleanup($vt2); $targetFolder->www_deployPackage(); @@ -107,7 +107,7 @@ isa_ok($deployedFolderChildren->[0] , 'WebGUI::Asset::Snippet', 'deployed child $folder->addRevision({isPackage => 0}); my $newVersionTag = WebGUI::VersionTag->getWorking($session); -WebGUI::Test->tagsToRollback($newVersionTag); +WebGUI::Test->addToCleanup($newVersionTag); $newVersionTag->commit; my $newFolder = WebGUI::Asset->new($session, $folder->getId); @@ -123,7 +123,7 @@ is($updatedSnippet->get('snippet'), 'Always upgrade to the latest version', 'imp cmp_ok( $updatedSnippet->get('revisionDate'), '>', $snippetRev->get('revisionDate'), '... revisionDate check on imported package with overwriteLatest'); my $lastTag = WebGUI::VersionTag->getWorking($session); -WebGUI::Test->tagsToRollback($lastTag); +WebGUI::Test->addToCleanup($lastTag); { # Test clearPackageFlag diff --git a/t/Asset/AssetTrash.t b/t/Asset/AssetTrash.t index ae4e15f3d..05d1c4fce 100644 --- a/t/Asset/AssetTrash.t +++ b/t/Asset/AssetTrash.t @@ -26,7 +26,7 @@ my $session = WebGUI::Test->session; my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"AssetLineage Test"}); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my $root = WebGUI::Asset->getRoot($session); my $topFolder = $root->addChild({ diff --git a/t/Asset/AssetVersion.t b/t/Asset/AssetVersion.t index 64baa28b0..b49a0c6ac 100644 --- a/t/Asset/AssetVersion.t +++ b/t/Asset/AssetVersion.t @@ -87,12 +87,12 @@ is($versionTagCheck, $originalVersionTags, 'version tag cleaned up by deleting l $template = $root->addChild($propertyHash); my $tag1 = WebGUI::VersionTag->getWorking($session); $tag1->commit; -WebGUI::Test->tagsToRollback($tag1); +WebGUI::Test->addToCleanup($tag1); sleep 1; $templatev2 = $template->addRevision({template => 'Vie gates. Ich bin ein templater.'}); my $tag2 = WebGUI::VersionTag->getWorking($session); $tag2->commit; -WebGUI::Test->tagsToRollback($tag2); +WebGUI::Test->addToCleanup($tag2); note "purge"; checkTableEntries($templatev2->getId, 1,2,2); $versionTagCheck = $session->db->quickScalar(q{select count(*) from assetVersionTag}); diff --git a/t/Asset/EMSSubmissionForm.t b/t/Asset/EMSSubmissionForm.t index 96a1d445a..ada3f14ad 100644 --- a/t/Asset/EMSSubmissionForm.t +++ b/t/Asset/EMSSubmissionForm.t @@ -58,9 +58,9 @@ $submitGroupA->addUsers([$userA->userId,$userC->userId]); $submitGroupB->addUsers([$userB->userId,$userC->userId]); $attendees->addUsers([$userA->getId, $userB->getId, $userC->getId]); -WebGUI::Test->groupsToDelete($submitGroupA,$submitGroupB); -WebGUI::Test->groupsToDelete($registrars, $attendees); -WebGUI::Test->usersToDelete($userA,$userB,$userC,$registrar); +WebGUI::Test->addToCleanup($submitGroupA,$submitGroupB); +WebGUI::Test->addToCleanup($registrars, $attendees); +WebGUI::Test->addToCleanup($userA,$userB,$userC,$registrar); sub loginAdmin { $session->user({userId => 3}); } sub loginRgstr { $session->user({userId => $registrar->userId}); } @@ -77,7 +77,7 @@ loginAdmin; # Create a version tag to work in my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"EventManagementSystem Test"}); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); # Do our work in the import node my $node = WebGUI::Asset->getImportNode($session); @@ -121,7 +121,7 @@ my $i18n = $ems->i18n; $versionTag->commit; $versionTag = WebGUI::VersionTag->getWorking($session); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my $id1 = $ems->getNextSubmissionId; my $id2 = $ems->getNextSubmissionId; @@ -210,7 +210,7 @@ my $submission = { }; $session->request->setup_body($submission); my $sub1 = $frmA->addSubmission; -WebGUI::Test->assetsToPurge( $sub1 ); +WebGUI::Test->addToCleanup( $sub1 ); print join( "\n", @{$sub1->{errors}} ),"\n" if defined $sub1->{errors}; my $isa1 = isa_ok( $sub1, 'WebGUI::Asset::EMSSubmission', "userA/formA valid submission succeeded" ); ok( $ems->hasSubmissions, 'UserA has submissions on this ems' ); @@ -228,7 +228,7 @@ $submission = { }; $session->request->setup_body($submission); my $sub2 = $frmB->addSubmission; -WebGUI::Test->assetsToPurge( $sub2 ); +WebGUI::Test->addToCleanup( $sub2 ); my $isa2 = isa_ok( $sub2, 'WebGUI::Asset::EMSSubmission', "userB/FormB valid submission succeeded" ); loginUserC; @@ -354,7 +354,7 @@ $sub1 = $sub1->cloneFromDb; is( $sub1->get('submissionStatus'),'created','approval successfull'); my $ticket = WebGUI::Asset->newByDynamicClass($session, $sub1->get('ticketId')); -WebGUI::Test->assetsToPurge( $ticket ) if $ticket ; +WebGUI::Test->addToCleanup( $ticket ) if $ticket ; SKIP: { skip 'no ticket created', 1 unless isa_ok( $ticket, 'WebGUI::Asset::Sku::EMSTicket', 'approval created a ticket'); is( $ticket->get('title'), $sub1->get('title'), 'Ticket title matches submission title' ); diff --git a/t/Asset/Event.t b/t/Asset/Event.t index 87c67b662..217df8aac 100644 --- a/t/Asset/Event.t +++ b/t/Asset/Event.t @@ -25,7 +25,7 @@ my $session = WebGUI::Test->session; my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Adding Calendar for Event Asset Test"}); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my $defaultAsset = WebGUI::Asset->getDefault($session); my $cal = $defaultAsset->addChild({className=>'WebGUI::Asset::Wobject::Calendar'}); $versionTag->commit; @@ -119,7 +119,7 @@ $properties3->{url} = 'event-asset-test6'; $properties3->{className} = 'WebGUI::Asset::Event'; my $eventStorage = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($eventStorage); +WebGUI::Test->addToCleanup($eventStorage); $properties3->{storageId} = $eventStorage->getId; my $event6 = $cal->addChild($properties3, $properties3->{id}); @@ -130,4 +130,4 @@ my $event6a = $event6->addRevision({ title => 'Event with storage', }, undef, { ok($session->id->valid($event6a->get('storageId')), 'addRevision gives the new revision a valid storageId'); isnt($event6a->get('storageId'), $event6->get('storageId'), '... and it is different from the previous revision'); my $versionTag2 = WebGUI::VersionTag->getWorking($session); -WebGUI::Test->tagsToRollback($versionTag2); +WebGUI::Test->addToCleanup($versionTag2); diff --git a/t/Asset/Event/edit.t b/t/Asset/Event/edit.t index 596e16c7b..9b9381019 100644 --- a/t/Asset/Event/edit.t +++ b/t/Asset/Event/edit.t @@ -37,7 +37,7 @@ $session->setting->set( 'defaultVersionTagWorkflow', 'pbworkflow000000000003' ); # Create a user for testing purposes my $user = WebGUI::User->new( $session, "new" ); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); $user->username( 'dufresne' . time ); my $identifier = 'ritahayworth'; my $auth = WebGUI::Operation::Auth::getInstance( $session, $user->authMethod, $user->userId ); diff --git a/t/Asset/Event/permissions.t b/t/Asset/Event/permissions.t index 393e34384..da03bb13e 100644 --- a/t/Asset/Event/permissions.t +++ b/t/Asset/Event/permissions.t @@ -33,7 +33,7 @@ push @versionTags, WebGUI::VersionTag->getWorking($session); $versionTags[-1]->set({name=>"Photo Test, add Gallery, Album and 1 Photo"}); my $registeredUser = WebGUI::User->new( $session, "new" ); -WebGUI::Test->usersToDelete($registeredUser); +WebGUI::Test->addToCleanup($registeredUser); # Make a Calendar to add events do my $calendar = $node->addChild({ diff --git a/t/Asset/File/GalleryFile/Photo/edit.t b/t/Asset/File/GalleryFile/Photo/edit.t index 8ad38f36d..64c476d4f 100644 --- a/t/Asset/File/GalleryFile/Photo/edit.t +++ b/t/Asset/File/GalleryFile/Photo/edit.t @@ -46,7 +46,7 @@ $session->setting->set( 'specialState', '' ); # Create a user for testing purposes my $user = WebGUI::User->new( $session, "new" ); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); $user->username( 'dufresne' . time ); my $identifier = 'ritahayworth'; my $auth = WebGUI::Operation::Auth::getInstance( $session, $user->authMethod, $user->userId ); diff --git a/t/Asset/File/GalleryFile/Photo/permissions.t b/t/Asset/File/GalleryFile/Photo/permissions.t index ee4f58c3e..b8b73fbad 100644 --- a/t/Asset/File/GalleryFile/Photo/permissions.t +++ b/t/Asset/File/GalleryFile/Photo/permissions.t @@ -29,16 +29,16 @@ my $maker = WebGUI::Test::Maker::Permission->new; $session->user({ userId => 3 }); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Photo Test, add Gallery, Album and 1 Photo"}); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); # Add a new user to the test user's friends list my $friend = WebGUI::User->new($session, "new"); -WebGUI::Test->usersToDelete($friend); +WebGUI::Test->addToCleanup($friend); WebGUI::Friends->new($session)->add( [ $friend->userId ] ); # Add a new registered user my $notFriend = WebGUI::User->new( $session, "new" ); -WebGUI::Test->usersToDelete($notFriend); +WebGUI::Test->addToCleanup($notFriend); my $gallery = $node->addChild({ diff --git a/t/Asset/Post.t b/t/Asset/Post.t index a460d31b3..98e7a01dd 100644 --- a/t/Asset/Post.t +++ b/t/Asset/Post.t @@ -54,7 +54,7 @@ my $otherUser = WebGUI::User->new($session, 'new'); my $groupIdEditUser = WebGUI::User->new($session, 'new'); my $groupToEditPostId = $collab->get('groupToEditPost'); my $groupIdEdit = $collab->get('groupIdEdit'); -WebGUI::Test->usersToDelete($postingUser, $otherUser, $groupIdEditUser); +WebGUI::Test->addToCleanup($postingUser, $otherUser, $groupIdEditUser); $postingUser->username('userForPosting'); $otherUser->username('otherUser'); @@ -83,7 +83,7 @@ my $props = { my $post = $collab->addChild($props, @addArgs); $versionTag->commit(); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); # Test for a sane object type isa_ok($post, 'WebGUI::Asset::Post::Thread'); @@ -148,7 +148,7 @@ my $post2 = $collab->addChild({ ownerUserId => 1, }, @addArgs); $versionTag2->commit(); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my $variables; $session->user({userId => 1}); $variables = $post1->getTemplateVars(); diff --git a/t/Asset/Post/Thread/permission.t b/t/Asset/Post/Thread/permission.t index 240c58b65..02448c13a 100644 --- a/t/Asset/Post/Thread/permission.t +++ b/t/Asset/Post/Thread/permission.t @@ -30,11 +30,11 @@ my $node = WebGUI::Asset->getImportNode( $session ); my %user; $user{"2"} = WebGUI::User->new( $session, "new" ); -WebGUI::Test->usersToDelete($user{'2'}); +WebGUI::Test->addToCleanup($user{'2'}); $user{"2"}->addToGroups( ['2'] ); # Registered user my $versionTag = WebGUI::VersionTag->getWorking( $session ); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); $versionTag->set( { name => "Collaboration Test" } ); my @addArgs = ( undef, undef, { skipAutoCommitWorkflows => 1, skipNotification => 1 } ); diff --git a/t/Asset/Post/permission.t b/t/Asset/Post/permission.t index dcd0fd63b..a896f3eb1 100644 --- a/t/Asset/Post/permission.t +++ b/t/Asset/Post/permission.t @@ -30,12 +30,12 @@ my $node = WebGUI::Asset->getImportNode( $session ); my %user; $user{"2"} = WebGUI::User->new( $session, "new" ); -WebGUI::Test->usersToDelete($user{'2'}); +WebGUI::Test->addToCleanup($user{'2'}); $user{"2"}->addToGroups( ['2'] ); # Registered user my $versionTag = WebGUI::VersionTag->getWorking( $session ); $versionTag->set( { name => "Collaboration Test" } ); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my @addArgs = ( undef, undef, { skipAutoCommitWorkflows => 1, skipNotification => 1 } ); diff --git a/t/Asset/Redirect/mech.t b/t/Asset/Redirect/mech.t index 6eb98881c..875ed103c 100644 --- a/t/Asset/Redirect/mech.t +++ b/t/Asset/Redirect/mech.t @@ -37,7 +37,7 @@ $session->setting->set( 'specialState', '' ); # Create a user for testing purposes my $user = WebGUI::User->new( $session, "new" ); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); $user->username( 'dufresne' ); my $identifier = 'ritahayworth'; my $auth = WebGUI::Operation::Auth::getInstance( $session, $user->authMethod, $user->userId ); diff --git a/t/Asset/Shortcut/010-linked-asset.t b/t/Asset/Shortcut/010-linked-asset.t index ab3eec740..6c061fb4e 100644 --- a/t/Asset/Shortcut/010-linked-asset.t +++ b/t/Asset/Shortcut/010-linked-asset.t @@ -148,7 +148,7 @@ ok( sub init { my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Shortcut Test"}); - WebGUI::Test->tagsToRollback($versionTag); + WebGUI::Test->addToCleanup($versionTag); # Make a snippet to shortcut $snippet = $node->addChild({ diff --git a/t/Asset/Sku/Product.t b/t/Asset/Sku/Product.t index c649bdaf7..b19dfd3c2 100644 --- a/t/Asset/Sku/Product.t +++ b/t/Asset/Sku/Product.t @@ -51,7 +51,7 @@ my $product = $node->addChild({ is($product->getThumbnailUrl(), '', 'Product with no image1 property returns the empty string'); my $image = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($image); +WebGUI::Test->addToCleanup($image); $image->addFileFromFilesystem(WebGUI::Test->getTestCollateralPath('lamp.jpg')); $image->generateThumbnail('lamp.jpg'); @@ -66,7 +66,7 @@ ok($imagedProduct->getThumbnailUrl(), 'getThumbnailUrl is not empty'); is($imagedProduct->getThumbnailUrl(), $image->getThumbnailUrl('lamp.jpg'), 'getThumbnailUrl returns the right path to the URL'); my $otherImage = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($otherImage); +WebGUI::Test->addToCleanup($otherImage); $otherImage->addFileFromFilesystem(WebGUI::Test->getTestCollateralPath('gooey.jpg')); $otherImage->generateThumbnail('gooey.jpg'); @@ -112,7 +112,7 @@ cmp_deeply( my $tag = WebGUI::VersionTag->getWorking($session); $tag->commit; -WebGUI::Test->tagsToRollback($tag); +WebGUI::Test->addToCleanup($tag); #################################################### # @@ -126,7 +126,7 @@ my $newImagedProduct = $imagedProduct->addRevision({title => 'Bible and hammer'} like($newImagedProduct->get('image1'), $session->id->getValidator, 'addRevision: new product rev got an image1 storage location'); isnt($newImagedProduct->get('image1'), $imagedProduct->get('image1'), '... and it is not the same as the old one'); -WebGUI::Test->tagsToRollback(WebGUI::VersionTag->getWorking($session)); +WebGUI::Test->addToCleanup(WebGUI::VersionTag->getWorking($session)); WebGUI::VersionTag->getWorking($session)->commit; #################################################### @@ -163,7 +163,7 @@ my $viewProduct = $node->addChild({ my $tag2 = WebGUI::VersionTag->getWorking($session); $tag2->commit; -WebGUI::Test->tagsToRollback($tag2); +WebGUI::Test->addToCleanup($tag2); ##Fetch a copy from the db, just like a page fetch $viewProduct = WebGUI::Asset->new($session, $viewProduct->getId, 'WebGUI::Asset::Sku::Product'); diff --git a/t/Asset/Sku/Subscription.t b/t/Asset/Sku/Subscription.t index 83510b083..eb4502172 100644 --- a/t/Asset/Sku/Subscription.t +++ b/t/Asset/Sku/Subscription.t @@ -37,9 +37,9 @@ plan tests => 4; # Increment this number for each test you create # put your tests here my $root = WebGUI::Asset->getRoot($session); my $group = WebGUI::Group->new($session, 'new'); -WebGUI::Test->groupsToDelete($group); +WebGUI::Test->addToCleanup($group); my $user = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); my $sku = $root->addChild({ className => "WebGUI::Asset::Sku::Subscription", @@ -50,7 +50,7 @@ my $sku = $root->addChild({ duration => 'Monthly', }); my $versionTag = WebGUI::VersionTag->getWorking($session); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); isa_ok($sku, "WebGUI::Asset::Sku::Subscription"); is($sku->getPrice, 50.00, "Price should be 50.00"); diff --git a/t/Asset/Story.t b/t/Asset/Story.t index 5c12248bc..b480a35b8 100644 --- a/t/Asset/Story.t +++ b/t/Asset/Story.t @@ -38,8 +38,8 @@ my $reader = WebGUI::User->create($session); $postUser->username('Can Post User'); $reader->username('Average Reader'); $archiveOwner->username('Archive Owner'); -WebGUI::Test->groupsToDelete($canPostGroup); -WebGUI::Test->usersToDelete($postUser, $archiveOwner, $reader); +WebGUI::Test->addToCleanup($canPostGroup); +WebGUI::Test->addToCleanup($postUser, $archiveOwner, $reader); my $canEditMaker = WebGUI::Test::Maker::Permission->new(); $canEditMaker->prepare({ @@ -69,11 +69,11 @@ my $topic = $defaultNode->addChild({ }); my $archiveTag = WebGUI::VersionTag->getWorking($session); $archiveTag->commit; -WebGUI::Test->tagsToRollback($archiveTag); +WebGUI::Test->addToCleanup($archiveTag); my $storage1 = WebGUI::Storage->create($session); my $storage2 = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($storage1, $storage2); +WebGUI::Test->addToCleanup($storage1, $storage2); ############################################################ # @@ -421,7 +421,7 @@ cmp_deeply( isnt($newPhotoData->[0]->{storageId}, $photoData->[0]->{storageId}, '... and storage 0 is duplicated'); isnt($newPhotoData->[1]->{storageId}, $photoData->[1]->{storageId}, '... and storage 1 is duplicated'); -WebGUI::Test->storagesToDelete( map { $_->{storageId} } @{ $newPhotoData } ); +WebGUI::Test->addToCleanup( map { ( 'WebGUI::Storage' => $_->{storageId} ) } @{ $newPhotoData } ); ############################################################ # diff --git a/t/Asset/Template.t b/t/Asset/Template.t index c82849165..3f3c0f05b 100644 --- a/t/Asset/Template.t +++ b/t/Asset/Template.t @@ -182,5 +182,5 @@ like($logError, qr/$brokenUrl/, 'process: logged error has the url'); like($logError, qr/$brokenId/, '... and the template id'); WebGUI::Test->restoreLogging; -WebGUI::Test->tagsToRollback(WebGUI::VersionTag->getWorking($session)); +WebGUI::Test->addToCleanup(WebGUI::VersionTag->getWorking($session)); diff --git a/t/Asset/Template/packed.t b/t/Asset/Template/packed.t index 4d547d37d..86ed1a706 100644 --- a/t/Asset/Template/packed.t +++ b/t/Asset/Template/packed.t @@ -36,7 +36,7 @@ my $templates = WebGUI::Asset->getRoot( $session ) ->getLineage( ['descendants'], { includeOnlyClasses => [ 'WebGUI::Asset::Template' ], } ); -WebGUI::Test->tagsToRollback( WebGUI::VersionTag->getWorking( $session ) ); +WebGUI::Test->addToCleanup( WebGUI::VersionTag->getWorking( $session ) ); #---------------------------------------------------------------------------- # Tests diff --git a/t/Asset/WikiPage.t b/t/Asset/WikiPage.t index 853a7566c..7c914b0ef 100644 --- a/t/Asset/WikiPage.t +++ b/t/Asset/WikiPage.t @@ -53,7 +53,7 @@ is($article, undef, "Can't add an Article wobject as a child to a Wiki Page."); my $wikiPageCopy = $wikipage->duplicate(); isa_ok($wikiPageCopy, 'WebGUI::Asset::WikiPage'); my $thirdVersionTag = WebGUI::VersionTag->new($session,$wikiPageCopy->get("tagId")); -WebGUI::Test->tagsToRollback($thirdVersionTag); +WebGUI::Test->addToCleanup($thirdVersionTag); ## isProtected diff --git a/t/Asset/WikiPage/subscribable.t b/t/Asset/WikiPage/subscribable.t index 468a83cd8..7dbcff4f5 100644 --- a/t/Asset/WikiPage/subscribable.t +++ b/t/Asset/WikiPage/subscribable.t @@ -36,7 +36,7 @@ my $page className => 'WebGUI::Asset::WikiPage', }, undef, undef, { skipAutoCommitWorkflows => 1 } ); -WebGUI::Test->tagsToRollback( WebGUI::VersionTag->getWorking( $session ) ); +WebGUI::Test->addToCleanup( WebGUI::VersionTag->getWorking( $session ) ); #---------------------------------------------------------------------------- # Tests diff --git a/t/Asset/Wobject/Article.t b/t/Asset/Wobject/Article.t index afaa24970..fd4c67b33 100644 --- a/t/Asset/Wobject/Article.t +++ b/t/Asset/Wobject/Article.t @@ -40,7 +40,7 @@ my $node = WebGUI::Asset->getImportNode($session); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Article Test"}); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my $article = $node->addChild({className=>'WebGUI::Asset::Wobject::Article'}); # Test for a sane object type @@ -71,7 +71,7 @@ my $pathedFile = WebGUI::Test->getTestCollateralPath($filename); # Use some test collateral to create a storage location and assign it to our article my $storage = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($storage); +WebGUI::Test->addToCleanup($storage); my $storedFilename = $storage->addFileFromFilesystem($pathedFile); my $filenameOK = is ($storedFilename, $filename, 'storage created correctly'); diff --git a/t/Asset/Wobject/Collaboration/permission.t b/t/Asset/Wobject/Collaboration/permission.t index 87f24ea98..2e2678096 100644 --- a/t/Asset/Wobject/Collaboration/permission.t +++ b/t/Asset/Wobject/Collaboration/permission.t @@ -31,7 +31,7 @@ my $node = WebGUI::Asset->getImportNode( $session ); my %user; $user{"2"} = WebGUI::User->new( $session, "new" ); $user{"2"}->addToGroups( ['2'] ); # Registered user -WebGUI::Test->usersToDelete($user{'2'}); +WebGUI::Test->addToCleanup($user{'2'}); my $versionTag = WebGUI::VersionTag->getWorking( $session ); $versionTag->set( { name => "Collaboration Test" } ); diff --git a/t/Asset/Wobject/Collaboration/unarchiveAll.t b/t/Asset/Wobject/Collaboration/unarchiveAll.t index cb3866b07..3ec155115 100644 --- a/t/Asset/Wobject/Collaboration/unarchiveAll.t +++ b/t/Asset/Wobject/Collaboration/unarchiveAll.t @@ -40,7 +40,7 @@ my @threads = ( my $tag = WebGUI::VersionTag->getWorking( $session ); $tag->commit; -WebGUI::Test->tagsToRollback($tag); +WebGUI::Test->addToCleanup($tag); #---------------------------------------------------------------------------- # Tests diff --git a/t/Asset/Wobject/DataForm.t b/t/Asset/Wobject/DataForm.t index 0d3d7ab1e..dea735556 100644 --- a/t/Asset/Wobject/DataForm.t +++ b/t/Asset/Wobject/DataForm.t @@ -43,7 +43,7 @@ my $dform = WebGUI::Asset->getDefault($session)->addChild({ $dform->createField('gotCaptcha', { type => 'Captcha', name => 'humanCheck', }); my $versionTag = WebGUI::VersionTag->getWorking($session); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); $versionTag->commit; #---------------------------------------------------------------------------- diff --git a/t/Asset/Wobject/EventManagementSystem.t b/t/Asset/Wobject/EventManagementSystem.t index d395acf83..cc6b3d15d 100644 --- a/t/Asset/Wobject/EventManagementSystem.t +++ b/t/Asset/Wobject/EventManagementSystem.t @@ -32,10 +32,10 @@ my $session = WebGUI::Test->session; my $registrar = WebGUI::User->create($session); my $attender = WebGUI::User->create($session); my $crasher = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($registrar, $attender, $crasher); +WebGUI::Test->addToCleanup($registrar, $attender, $crasher); my $registrars = WebGUI::Group->new($session, 'new'); my $attendees = WebGUI::Group->new($session, 'new'); -WebGUI::Test->groupsToDelete($registrars, $attendees); +WebGUI::Test->addToCleanup($registrars, $attendees); $registrars->addUsers([$registrar->getId]); $attendees->addUsers([$attender->getId]); @@ -71,7 +71,7 @@ my $ems = $node->addChild({ groupIdView => $attendees->getId }); $versionTag->commit; -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); # Test for a sane object type isa_ok($ems, 'WebGUI::Asset::Wobject::EventManagementSystem'); diff --git a/t/Asset/Wobject/Gallery/permission.t b/t/Asset/Wobject/Gallery/permission.t index 7b07921d5..0b167aa4f 100644 --- a/t/Asset/Wobject/Gallery/permission.t +++ b/t/Asset/Wobject/Gallery/permission.t @@ -25,12 +25,12 @@ my $session = WebGUI::Test->session; my $node = WebGUI::Asset->getImportNode($session); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Gallery Test"}); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my $maker = WebGUI::Test::Maker::Permission->new; my $gallery; my $nonAdmin = WebGUI::User->new( $session, "new" ); -WebGUI::Test->usersToDelete($nonAdmin); +WebGUI::Test->addToCleanup($nonAdmin); #---------------------------------------------------------------------------- diff --git a/t/Asset/Wobject/GalleryAlbum/ajax.t b/t/Asset/Wobject/GalleryAlbum/ajax.t index 679137595..5dbddf7f0 100644 --- a/t/Asset/Wobject/GalleryAlbum/ajax.t +++ b/t/Asset/Wobject/GalleryAlbum/ajax.t @@ -28,9 +28,9 @@ my $versionTag = WebGUI::VersionTag->getWorking($session); my %user; $user{'1'} = WebGUI::User->new( $session, "new" ); $user{'1'}->addToGroups( ['3'] ); # Admins -WebGUI::Test->usersToDelete($user{'1'}); +WebGUI::Test->addToCleanup($user{'1'}); $user{'2'} = WebGUI::User->new( $session, "new" ); -WebGUI::Test->usersToDelete($user{'2'}); +WebGUI::Test->addToCleanup($user{'2'}); # Create everything as user no. 1 $session->user({ user => $user{'1'} }); diff --git a/t/Asset/Wobject/GalleryAlbum/edit.t b/t/Asset/Wobject/GalleryAlbum/edit.t index 50982aa93..2043d0518 100644 --- a/t/Asset/Wobject/GalleryAlbum/edit.t +++ b/t/Asset/Wobject/GalleryAlbum/edit.t @@ -37,7 +37,7 @@ $session->setting->set( 'specialState', '' ); # Create a user for testing purposes my $user = WebGUI::User->new( $session, "new" ); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); $user->username( 'dufresne' . time ); my $identifier = 'ritahayworth'; my $auth = WebGUI::Operation::Auth::getInstance( $session, $user->authMethod, $user->userId ); @@ -60,7 +60,7 @@ my $gallery } ); $versionTags[-1]->commit; -WebGUI::Test->tagsToRollback(@versionTags); +WebGUI::Test->addToCleanup(@versionTags); #---------------------------------------------------------------------------- # Tests diff --git a/t/Asset/Wobject/GalleryAlbum/permission.t b/t/Asset/Wobject/GalleryAlbum/permission.t index 86a0dcd98..5b05ca872 100644 --- a/t/Asset/Wobject/GalleryAlbum/permission.t +++ b/t/Asset/Wobject/GalleryAlbum/permission.t @@ -28,7 +28,7 @@ my $node = WebGUI::Asset->getImportNode($session); my %user; $user{"2"} = WebGUI::User->new( $session, "new" ); $user{"2"}->addToGroups( ['2'] ); # Registered user -WebGUI::Test->usersToDelete($user{'2'}); +WebGUI::Test->addToCleanup($user{'2'}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Album Test"}); diff --git a/t/Asset/Wobject/GalleryAlbum/rss.t b/t/Asset/Wobject/GalleryAlbum/rss.t index 08852634b..989eaacba 100644 --- a/t/Asset/Wobject/GalleryAlbum/rss.t +++ b/t/Asset/Wobject/GalleryAlbum/rss.t @@ -28,7 +28,7 @@ my $session = WebGUI::Test->session; my $node = WebGUI::Asset->getImportNode($session); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Album Test"}); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my $gallery = $node->addChild({ className => "WebGUI::Asset::Wobject::Gallery", diff --git a/t/Asset/Wobject/InOutBoard.t b/t/Asset/Wobject/InOutBoard.t index 4a0873283..bc5896e8e 100644 --- a/t/Asset/Wobject/InOutBoard.t +++ b/t/Asset/Wobject/InOutBoard.t @@ -44,14 +44,14 @@ foreach my $name (@names) { $user->username($name); push @users, $user; } -WebGUI::Test->usersToDelete(@users); +WebGUI::Test->addToCleanup(@users); # Do our work in the import node my $node = WebGUI::Asset->getImportNode($session); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"InOutBoard Test"}); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my $board = $node->addChild({ className => 'WebGUI::Asset::Wobject::InOutBoard', inOutTemplateId => $templateId, diff --git a/t/Asset/Wobject/Matrix.t b/t/Asset/Wobject/Matrix.t index 115841b59..bd810225e 100644 --- a/t/Asset/Wobject/Matrix.t +++ b/t/Asset/Wobject/Matrix.t @@ -29,7 +29,7 @@ my $node = WebGUI::Asset->getImportNode($session); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Matrix Test"}); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my $matrix = $node->addChild({className=>'WebGUI::Asset::Wobject::Matrix'}); # Test for a sane object type @@ -108,7 +108,7 @@ my $matrixListing = $matrix->addChild({className=>'WebGUI::Asset::MatrixListing' my $secondVersionTag = WebGUI::VersionTag->new($session,$matrixListing->get("tagId")); $secondVersionTag->commit; -WebGUI::Test->tagsToRollback($secondVersionTag); +WebGUI::Test->addToCleanup($secondVersionTag); # Test for sane object type isa_ok($matrixListing, 'WebGUI::Asset::MatrixListing'); diff --git a/t/Asset/Wobject/Poll.t b/t/Asset/Wobject/Poll.t index 4cfdfd624..096a8bc23 100644 --- a/t/Asset/Wobject/Poll.t +++ b/t/Asset/Wobject/Poll.t @@ -77,7 +77,7 @@ my $poll = $defaultNode->addChild({ }); my $versionTag = WebGUI::VersionTag->getWorking($session); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); $versionTag->commit; isa_ok($poll, 'WebGUI::Asset::Wobject::Poll'); diff --git a/t/Asset/Wobject/Shelf.t b/t/Asset/Wobject/Shelf.t index dd0bf23f9..41a70152d 100644 --- a/t/Asset/Wobject/Shelf.t +++ b/t/Asset/Wobject/Shelf.t @@ -447,7 +447,7 @@ SKIP: { ##Clear out this tag so we can do downstream work. my $tag = WebGUI::VersionTag->getWorking($session); $tag->commit; - WebGUI::Test->tagsToRollback($tag); + WebGUI::Test->addToCleanup($tag); ####################################################################### # @@ -457,9 +457,9 @@ SKIP: { my $tommy = WebGUI::User->create($session); my $warden = WebGUI::User->create($session); - WebGUI::Test->usersToDelete($tommy, $warden); + WebGUI::Test->addToCleanup($tommy, $warden); my $inGroup = WebGUI::Group->new($session, 'new'); - WebGUI::Test->groupsToDelete($inGroup); + WebGUI::Test->addToCleanup($inGroup); $inGroup->addUsers([$tommy->getId]); my $testTemplate = $root->addChild({ @@ -471,7 +471,7 @@ SKIP: { templateId => $testTemplate->getId, }); my $tag2 = WebGUI::VersionTag->getWorking($session); - WebGUI::Test->tagsToRollback($tag2); + WebGUI::Test->addToCleanup($tag2); $tag2->commit; $session->user({userId => 1}); $testShelf->prepareView; @@ -486,7 +486,7 @@ SKIP: { title => 'Private Product', }); my $tag3 = WebGUI::VersionTag->getWorking($session); - WebGUI::Test->tagsToRollback($tag3); + WebGUI::Test->addToCleanup($tag3); $tag3->commit; $session->user({user => $tommy}); diff --git a/t/Asset/Wobject/StoryArchive.t b/t/Asset/Wobject/StoryArchive.t index 96e8c9caa..bd69eec1e 100644 --- a/t/Asset/Wobject/StoryArchive.t +++ b/t/Asset/Wobject/StoryArchive.t @@ -40,7 +40,7 @@ use DateTime; my $session = WebGUI::Test->session; my $staff = WebGUI::Group->new($session, 'new'); -WebGUI::Test->groupsToDelete($staff); +WebGUI::Test->addToCleanup($staff); $staff->name('Reporting Staff'); my $reporter = WebGUI::User->new($session, 'new'); @@ -50,7 +50,7 @@ $editor->username('editor'); my $reader = WebGUI::User->new($session, 'new'); $reader->username('reader'); $staff->addUsers([$reporter->userId]); -WebGUI::Test->usersToDelete($reporter, $editor, $reader); +WebGUI::Test->addToCleanup($reporter, $editor, $reader); my $archive = 'placeholder for Test::Maker::Permission'; @@ -94,7 +94,7 @@ $archive = $home->addChild({ }); $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->commit; -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); isa_ok($archive, 'WebGUI::Asset::Wobject::StoryArchive', 'created StoryArchive'); @@ -172,7 +172,7 @@ $child->purge; $child = $archive->addChild({className => 'WebGUI::Asset::Story', title => 'First Story'}, @skipAutoCommit); my $tag1 = WebGUI::VersionTag->getWorking($session); $tag1->commit; -WebGUI::Test->tagsToRollback($tag1); +WebGUI::Test->addToCleanup($tag1); isa_ok($child, 'WebGUI::Asset::Story', 'addChild added and returned a Story'); is($archive->getChildCount, 1, '... added it to the archive'); my $folder = $archive->getFirstChild(); @@ -210,7 +210,7 @@ my $story = $oldFolder->addChild({ className => 'WebGUI::Asset::Story', title => $creationDateSth->execute([$wgBday, $story->getId]); my $tag2 = WebGUI::VersionTag->getWorking($session); $tag2->commit; -WebGUI::Test->tagsToRollback($tag2); +WebGUI::Test->addToCleanup($tag2); { my $storyDB = WebGUI::Asset->newByUrl($session, $story->getUrl); @@ -221,7 +221,7 @@ my $pastStory = $newFolder->addChild({ className => 'WebGUI::Asset::Story', titl $creationDateSth->execute([$yesterday, $pastStory->getId]); my $tag3 = WebGUI::VersionTag->getWorking($session); $tag3->commit; -WebGUI::Test->tagsToRollback($tag3); +WebGUI::Test->addToCleanup($tag3); my $templateVars; $templateVars = $archive->viewTemplateVariables(); @@ -297,7 +297,7 @@ foreach my $storilet ($story2, $story3, $story4) { $archive->update({storiesPerPage => 3}); my $tag4 = WebGUI::VersionTag->getWorking($session); $tag4->commit; -WebGUI::Test->tagsToRollback($tag4); +WebGUI::Test->addToCleanup($tag4); ##Don't assume that Admin and Visitor have the same timezone. $session->user({userId => 3}); @@ -585,7 +585,7 @@ cmp_deeply( ################################################################ my $exportStorage = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($exportStorage); +WebGUI::Test->addToCleanup($exportStorage); my $basedir = Path::Class::Dir->new($exportStorage->getPath); $exportStorage->addFileFromScalar('index', 'export story archive content'); my $assetDir = $basedir->subdir('mystories'); diff --git a/t/Asset/Wobject/StoryTopic.t b/t/Asset/Wobject/StoryTopic.t index 4633454bc..8fa048afa 100644 --- a/t/Asset/Wobject/StoryTopic.t +++ b/t/Asset/Wobject/StoryTopic.t @@ -184,7 +184,7 @@ is($templateVars->{topStoryCreationDate}, $now, '... topStoryCreationDate'); ok($templateVars->{standAlone}, '... standAlone mode=1'); my $storage = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($storage); +WebGUI::Test->addToCleanup($storage); $storyHandler->{bogs}->setPhotoData([{ caption => "Octopus seen at the scene of Mrs. Dufresne's murder.", byLine => 'Elmo Blatch', diff --git a/t/Asset/Wobject/Survey.t b/t/Asset/Wobject/Survey.t index 1aa6125a7..7f156a398 100644 --- a/t/Asset/Wobject/Survey.t +++ b/t/Asset/Wobject/Survey.t @@ -26,7 +26,7 @@ plan tests => 47; my ($survey); my $user = WebGUI::User->new( $session, 'new' ); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); my $import_node = WebGUI::Asset->getImportNode($session); # Create a Survey @@ -119,7 +119,7 @@ ok($survey->responseId, '..(and similarly for responseId)'); $survey->update({maxResponsesPerUser => 1}); is($survey->takenCount( { userId => 1 } ), 0, 'Visitor has no responses'); my $u = WebGUI::User->new( $session, 'new' ); -WebGUI::Test->usersToDelete($u); +WebGUI::Test->addToCleanup($u); is($survey->takenCount( { userId => $u->userId } ), 0, 'New user has no responses'); delete $survey->{canTake}; delete $survey->{responseId}; @@ -240,7 +240,7 @@ cmp_deeply(from_json($surveyEnd), { type => 'forward', url => '/getting_started' # Create another response (this one will use the new revision) my $newUser = WebGUI::User->new( $session, 'new' ); - WebGUI::Test->usersToDelete($newUser); + WebGUI::Test->addToCleanup($newUser); $session->user({ user => $newUser }); my $newResponseId = $survey->responseId; is($newerSurvey->responseJSON->nextResponseSection()->{text}, 'newer text', 'New response uses the new text'); diff --git a/t/Asset/Wobject/Survey/ExpressionEngine.t b/t/Asset/Wobject/Survey/ExpressionEngine.t index 8acc0db17..0d1edcecd 100644 --- a/t/Asset/Wobject/Survey/ExpressionEngine.t +++ b/t/Asset/Wobject/Survey/ExpressionEngine.t @@ -188,7 +188,7 @@ SKIP: { # Create a test user $user = WebGUI::User->new( $session, 'new' ); - WebGUI::Test->usersToDelete($user); + WebGUI::Test->addToCleanup($user); # Create a Survey $versionTag = WebGUI::VersionTag->getWorking($session); @@ -244,7 +244,7 @@ SKIP: { # Create a second test user my $survey2 = WebGUI::Asset::Wobject::Survey->new($session, $survey->getId); my $user2 = WebGUI::User->new( $session, 'new' ); - WebGUI::Test->usersToDelete($user2); + WebGUI::Test->addToCleanup($user2); $session->user({userId => $user2->userId}); my $responseId2 = $survey2->responseId( { userId => $user2->userId } ); my $rJSON2 = $survey2->responseJSON(undef, $responseId2); diff --git a/t/Asset/Wobject/Survey/Reports.t b/t/Asset/Wobject/Survey/Reports.t index 3778d2de3..3c559b3b1 100644 --- a/t/Asset/Wobject/Survey/Reports.t +++ b/t/Asset/Wobject/Survey/Reports.t @@ -35,7 +35,7 @@ SKIP: { skip $tests, "Unable to load Survey" unless $usedOk; my $user = WebGUI::User->new( $session, 'new' ); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); my $import_node = WebGUI::Asset->getImportNode($session); # Create a Survey diff --git a/t/Asset/Wobject/Survey/Test.t b/t/Asset/Wobject/Survey/Test.t index 31faca5be..d4eb6d5ee 100644 --- a/t/Asset/Wobject/Survey/Test.t +++ b/t/Asset/Wobject/Survey/Test.t @@ -37,7 +37,7 @@ skip "Unable to load TAP::Parser and TAP::Parser::Aggregator", 88 unless $tp && use_ok('WebGUI::Asset::Wobject::Survey::Test'); my $user = WebGUI::User->new( $session, 'new' ); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); my $import_node = WebGUI::Asset->getImportNode($session); WebGUI::Test->originalConfig('enableSurveyExpressionEngine'); diff --git a/t/Asset/Wobject/Thingy.t b/t/Asset/Wobject/Thingy.t index 0844c2b77..bede0c5a8 100644 --- a/t/Asset/Wobject/Thingy.t +++ b/t/Asset/Wobject/Thingy.t @@ -36,7 +36,7 @@ $templateMock->mock('process', sub { $templateVars = $_[1]; } ); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Thingy Test"}); -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my $thingy = $node->addChild({className=>'WebGUI::Asset::Wobject::Thingy'}); # Test for a sane object type @@ -385,7 +385,7 @@ is($table, undef, '... drops thing specific table'); $thingy->editThingDataSave($newThingId, 'new', {"field_".$newFieldId => 'value 3'} ); my $andy = WebGUI::User->create($session); - WebGUI::Test->usersToDelete($andy); + WebGUI::Test->addToCleanup($andy); $session->user({userId => $andy->userId}); my $form = $thingy->getFormPlugin({ diff --git a/t/Asset/Wobject/WikiMaster/featured.t b/t/Asset/Wobject/WikiMaster/featured.t index ef0d98bab..952125e02 100644 --- a/t/Asset/Wobject/WikiMaster/featured.t +++ b/t/Asset/Wobject/WikiMaster/featured.t @@ -44,7 +44,7 @@ my $featuredPage content => 'A how-to book', }, undef, undef, { skipAutoCommitWorkflows => 1 } ); -WebGUI::Test->tagsToRollback( WebGUI::VersionTag->getWorking( $session ) ); +WebGUI::Test->addToCleanup( WebGUI::VersionTag->getWorking( $session ) ); #---------------------------------------------------------------------------- # Tests diff --git a/t/Asset/Wobject/WikiMaster/subscribable.t b/t/Asset/Wobject/WikiMaster/subscribable.t index 40a8d5d8b..6a385f448 100644 --- a/t/Asset/Wobject/WikiMaster/subscribable.t +++ b/t/Asset/Wobject/WikiMaster/subscribable.t @@ -32,7 +32,7 @@ my $wiki groupIdView => '7', # Everyone } ); -WebGUI::Test->tagsToRollback( WebGUI::VersionTag->getWorking( $session ) ); +WebGUI::Test->addToCleanup( WebGUI::VersionTag->getWorking( $session ) ); #---------------------------------------------------------------------------- # Tests diff --git a/t/AssetAspect/RssFeed.t b/t/AssetAspect/RssFeed.t index 014a6ca42..43686bfdd 100644 --- a/t/AssetAspect/RssFeed.t +++ b/t/AssetAspect/RssFeed.t @@ -153,7 +153,7 @@ cmp_deeply( ##################################################### my $exportStorage = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($exportStorage); +WebGUI::Test->addToCleanup($exportStorage); my $basedir = Path::Class::Dir->new($exportStorage->getPath); my $assetdir = $basedir->subdir('shawshank'); my $indexfile = $assetdir->file('index.html'); @@ -171,7 +171,7 @@ cmp_bag( ); $exportStorage = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($exportStorage); +WebGUI::Test->addToCleanup($exportStorage); $basedir = Path::Class::Dir->new($exportStorage->getPath); my $assetfile = $basedir->file('shawshank.html'); $dummy->exportAssetCollateral($assetfile, {}, $session); diff --git a/t/Auth/mech.t b/t/Auth/mech.t index dd1a80f8f..3f461794e 100644 --- a/t/Auth/mech.t +++ b/t/Auth/mech.t @@ -44,7 +44,7 @@ $session->setting->set( 'specialState', '' ); my $USERNAME = 'dufresne'; my $IDENTIFIER = 'ritahayworth'; my $user = WebGUI::User->new( $session, "new", "something new" ); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); $user->username( $USERNAME ); $user->addToGroups( ['3'] ); my $auth = WebGUI::Operation::Auth::getInstance( $session, $user->authMethod, $user->userId ); @@ -70,7 +70,7 @@ my $asset }); $versionTags[-1]->commit; my $assetUrl = $baseUrl . $asset->get('url'); -WebGUI::Test->tagsToRollback(@versionTags); +WebGUI::Test->addToCleanup(@versionTags); #---------------------------------------------------------------------------- # Tests diff --git a/t/FilePump/Bundle.t b/t/FilePump/Bundle.t index d0017c795..acecc392c 100644 --- a/t/FilePump/Bundle.t +++ b/t/FilePump/Bundle.t @@ -273,12 +273,12 @@ my $fileAsset = $root->addChild({ $fileAsset->getStorageLocation->addFileFromScalar('pumpfile', 'Pump up the jam'); my $storage = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($storage); +WebGUI::Test->addToCleanup($storage); $storage->addFileFromScalar('addendum', 'Red was too'); $storage->addFileFromFilesystem(WebGUI::Test->getTestCollateralPath('ShawshankRedemptionMoviePoster.jpg')); my $snippetTag = WebGUI::VersionTag->getWorking($session); -WebGUI::Test->tagsToRollback($snippetTag); +WebGUI::Test->addToCleanup($snippetTag); $snippetTag->commit; my $guts; diff --git a/t/Group.t b/t/Group.t index f6f6f662d..2ba0c9efc 100644 --- a/t/Group.t +++ b/t/Group.t @@ -205,7 +205,7 @@ foreach my $idx (0..$#ldapTests) { }); } -WebGUI::Test->usersToDelete(@shawshank); +WebGUI::Test->addToCleanup(@shawshank); my $lGroup = WebGUI::Group->new($session, 'new'); @@ -279,7 +279,7 @@ my $gB = WebGUI::Group->new($session, "new"); $gA->name('Group A'); $gB->name('Group B'); ok( ($gA->name eq 'Group A' and $gB->name eq 'Group B'), 'object name assignment, multiple objects'); -WebGUI::Test->groupsToDelete($gA, $gB); +WebGUI::Test->addToCleanup($gA, $gB); $gB->addGroups([$gA->getId]); @@ -301,7 +301,7 @@ cmp_bag($gA->getGroupsIn(), [3], 'Not allowed to add myself to my group'); my $gC = WebGUI::Group->new($session, "new"); $gC->name('Group C'); $gA->addGroups([$gC->getId]); -WebGUI::Test->groupsToDelete($gC); +WebGUI::Test->addToCleanup($gC); cmp_bag($gC->getGroupsFor(), [$gA->getId], 'Group A contains Group C'); cmp_bag($gA->getGroupsIn(), [$gC->getId, 3], 'Group C is a member of Group A, cached'); @@ -328,7 +328,7 @@ my $gZ = WebGUI::Group->new($session, "new"); $gX->name('Group X'); $gY->name('Group Y'); $gZ->name('Group Z'); -WebGUI::Test->groupsToDelete($gX, $gY, $gZ); +WebGUI::Test->addToCleanup($gX, $gY, $gZ); $gZ->addGroups([$gX->getId, $gY->getId]); @@ -354,7 +354,7 @@ cmp_bag($gY->getAllGroupsFor(), [ map {$_->getId} ($gZ, $gA, $gB) ], 'getAllGrou cmp_bag($gZ->getAllGroupsFor(), [ map {$_->getId} ($gA, $gB) ], 'getAllGroupsFor Z'); my $user = WebGUI::User->new($session, "new"); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); $gX->userIsAdmin($user->userId, "yes"); ok(!$gX->userIsAdmin($user->userId), "userIsAdmin: User who isn't secondary admin can't be group admin"); isnt($gX->userIsAdmin($user->userId), 'yes', "userIsAdmin returns 1 or 0, not value"); @@ -413,13 +413,13 @@ $user->delete; ################################################################ my @crowd = map { WebGUI::User->new($session, "new") } 0..7; -WebGUI::Test->usersToDelete(@crowd); +WebGUI::Test->addToCleanup(@crowd); my @mob; foreach my $idx (0..2) { $mob[$idx] = WebGUI::User->new($session, "new"); $mob[$idx]->username("mob$idx"); } -WebGUI::Test->usersToDelete(@mob); +WebGUI::Test->addToCleanup(@mob); my @bUsers = map { $_->userId } @crowd[0,1]; my @aUsers = map { $_->userId } @crowd[2,3]; @@ -453,10 +453,10 @@ cmp_bag($everyUsers, $everyoneGroup->getUsers(), 'addUsers will not add a user t ##Check expire time override on addUsers my $expireOverrideGroup = WebGUI::Group->new($session, 'new'); -WebGUI::Test->groupsToDelete($expireOverrideGroup); +WebGUI::Test->addToCleanup($expireOverrideGroup); $expireOverrideGroup->expireOffset('50'); my $expireOverrideUser = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($expireOverrideUser); +WebGUI::Test->addToCleanup($expireOverrideUser); $expireOverrideGroup->addUsers([$expireOverrideUser->userId], '5000'); my $expirationDate = $session->db->quickScalar('select expireDate from groupings where userId=?', [$expireOverrideUser->userId]); cmp_ok($expirationDate-time(), '>', 50, 'checking expire offset override on addUsers'); @@ -521,7 +521,7 @@ is_deeply( my $gK = WebGUI::Group->new($session, "new"); $gK->name('Group K'); $gC->addGroups([$gK->getId]); -WebGUI::Test->groupsToDelete($gK); +WebGUI::Test->addToCleanup($gK); # B # / \ @@ -538,7 +538,7 @@ foreach my $idx (0..3) { $chameleons[$idx] = WebGUI::User->new($session, "new"); $chameleons[$idx]->username("chameleon$idx"); } -WebGUI::Test->usersToDelete(@chameleons); +WebGUI::Test->addToCleanup(@chameleons); foreach my $idx (0..3) { $chameleons[$idx]->karma(5*$idx, 'testCode', 'testable karma, dude'); @@ -594,7 +594,7 @@ $session->setting->set('useKarma', $defaultKarmaSetting); my $gS = WebGUI::Group->new($session, "new"); $gS->name('Group S'); $gC->addGroups([$gS->getId]); -WebGUI::Test->groupsToDelete($gS); +WebGUI::Test->addToCleanup($gS); # B # / \ @@ -632,8 +632,8 @@ foreach my $idx (0..$#scratchTests) { $sessionBank[$idx]->scratch->set($name, $value); } } -WebGUI::Test->usersToDelete(@itchies); -WebGUI::Test->sessionsToDelete(@sessionBank); +WebGUI::Test->addToCleanup(@itchies); +WebGUI::Test->addToCleanup(@sessionBank); #isInGroup test foreach my $scratchTest (@scratchTests) { @@ -709,11 +709,11 @@ foreach my $idx (0..$#ipTests) { ##Assign this user to this test to be fetched later $ipTests[$idx]->{user} = $tcps[$idx]; } -WebGUI::Test->usersToDelete(@tcps); -WebGUI::Test->sessionsToDelete(@sessionBank); +WebGUI::Test->addToCleanup(@tcps); +WebGUI::Test->addToCleanup(@sessionBank); my $gI = WebGUI::Group->new($session, "new"); -WebGUI::Test->groupsToDelete($gI); +WebGUI::Test->addToCleanup($gI); $gI->name('Group I'); $gI->ipFilter('194.168.0.0/24'); @@ -771,7 +771,7 @@ foreach my $ipTest (@ipTests) { ##Cache check. my $cacheDude = WebGUI::User->new($session, "new"); -WebGUI::Test->usersToDelete($cacheDude); +WebGUI::Test->addToCleanup($cacheDude); $cacheDude->username('Cache Dude'); $gY->addUsers([$cacheDude->userId]); @@ -789,7 +789,7 @@ ok( !$cacheDude->isInGroup($gY->getId), "Cache dude removed from group Y by isIn ok( !$cacheDude->isInGroup($gZ->getId), "Cache dude removed from group Z too by isInGroup"); my $gCache = WebGUI::Group->new($session, "new"); -WebGUI::Test->groupsToDelete($gCache); +WebGUI::Test->addToCleanup($gCache); $gCache->addUsers([$cacheDude->userId]); diff --git a/t/Group/resetGroupFields.t b/t/Group/resetGroupFields.t index 58e7cb560..86227a08d 100644 --- a/t/Group/resetGroupFields.t +++ b/t/Group/resetGroupFields.t @@ -25,13 +25,13 @@ plan tests => 10; my $session = WebGUI::Test->session; my $assetGroup = WebGUI::Group->new($session, 'new'); -WebGUI::Test->groupsToDelete($assetGroup); +WebGUI::Test->addToCleanup($assetGroup); my $settingGroup = WebGUI::Group->new($session, 'new'); -WebGUI::Test->groupsToDelete($settingGroup); +WebGUI::Test->addToCleanup($settingGroup); my $activityGroup = WebGUI::Group->new($session, 'new'); -WebGUI::Test->groupsToDelete($activityGroup); +WebGUI::Test->addToCleanup($activityGroup); my $home = WebGUI::Asset->getDefault($session); @@ -89,7 +89,7 @@ my $workflow = WebGUI::Workflow->create($session, mode => 'realtime', }, ); -WebGUI::Test->workflowsToDelete($workflow); +WebGUI::Test->addToCleanup($workflow); WebGUI::Test->originalConfig('workflowActivities'); $session->config->addToArray('workflowActivities/User', 'WebGUI::Workflow::Activity::AddUserToGroup'); @@ -177,4 +177,4 @@ $activityGroup->delete; my $userActivity2 = WebGUI::Workflow::Activity->new($session, $userActivity->getId); is ($userActivity2->get('groupId'), 3, 'group in Workflow Activity set to Admin'); -WebGUI::Test->tagsToRollback(WebGUI::VersionTag->getWorking($session)); +WebGUI::Test->addToCleanup(WebGUI::VersionTag->getWorking($session)); diff --git a/t/Inbox.t b/t/Inbox.t index 3af427551..1b5d156e0 100644 --- a/t/Inbox.t +++ b/t/Inbox.t @@ -76,7 +76,7 @@ my @senders = (); push @senders, WebGUI::User->create($session); push @senders, WebGUI::User->create($session); push @senders, WebGUI::User->create($session); -WebGUI::Test->usersToDelete(@senders); +WebGUI::Test->addToCleanup(@senders); $senders[0]->username('first'); $senders[0]->profileField('firstName', 'First Only'); $senders[1]->username('last'); diff --git a/t/Inbox/Groups.t b/t/Inbox/Groups.t index e8264a553..bf5bbe8fb 100644 --- a/t/Inbox/Groups.t +++ b/t/Inbox/Groups.t @@ -39,17 +39,17 @@ use Data::Dumper; my $session = WebGUI::Test->session; my $userFred = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($userFred); +WebGUI::Test->addToCleanup($userFred); $userFred->username('fred'); $userFred->profileField('receiveInboxEmailNotifications', 0); my $userBill = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($userBill); +WebGUI::Test->addToCleanup($userBill); $userBill->username('bill'); $userBill->profileField('receiveInboxEmailNotifications', 0); my $group = WebGUI::Group->new($session, 'new'); -WebGUI::Test->groupsToDelete($group); +WebGUI::Test->addToCleanup($group); $group->addUsers([$userFred->userId, $userBill->userId]); my $inbox = WebGUI::Inbox->new($session); diff --git a/t/Keyword.t b/t/Keyword.t index 03e5e55d7..4f2fd5687 100644 --- a/t/Keyword.t +++ b/t/Keyword.t @@ -69,7 +69,7 @@ my $snippet = $home->addChild({ }); my $tag = WebGUI::VersionTag->getWorking($session); -WebGUI::Test->tagsToRollback($tag); +WebGUI::Test->addToCleanup($tag); $tag->commit; my $assetIds = $keyword->getMatchingAssets({ keyword => 'webgui', }); diff --git a/t/Macro.t b/t/Macro.t index fc59533ce..d0aecdec2 100644 --- a/t/Macro.t +++ b/t/Macro.t @@ -31,7 +31,7 @@ $session->asset($defaultAsset); ##Create a non-admin user who will be in the Registered User group my $registeredUser = WebGUI::User->new($session, "new"); $registeredUser->username('TimBob'); -WebGUI::Test->usersToDelete($registeredUser); +WebGUI::Test->addToCleanup($registeredUser); $session->user({user => $registeredUser}); WebGUI::Test->originalConfig('macros'); diff --git a/t/Macro/FilePump.t b/t/Macro/FilePump.t index cb5237e33..9558071b0 100644 --- a/t/Macro/FilePump.t +++ b/t/Macro/FilePump.t @@ -54,14 +54,14 @@ $fileAsset->getStorageLocation->addFileFromScalar('pumpfile.css', qq| body {\n is($fileAsset->getStorageLocation->getFileContentsAsScalar($fileAsset->get('filename')), qq| body {\npadding: 0px;}\n\n|, 'Sanity check - got back expected file contents'); my $snippetTag = WebGUI::VersionTag->getWorking($session); -WebGUI::Test->tagsToRollback($snippetTag); +WebGUI::Test->addToCleanup($snippetTag); $snippetTag->commit; ok($bundle->addFile('JS', 'asset://filePumpSnippet'), 'Added filePumpSnippet'); ok($bundle->addFile('CSS', 'asset://filePumpFileAsset'), 'Added filePumpAsset'); my $storedFile = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($storedFile); +WebGUI::Test->addToCleanup($storedFile); $storedFile->addFileFromScalar('storedJS.js', qq|function helloWorld() { alert("Hellow world");}|, ); # Turn into file:uploads/path/to/fileAsset (bc file uris must begin with either file:uploads/ or file:extras/) my $path = Path::Class::File->new($storedFile->getPath($storedFile->get('filename'))); diff --git a/t/Macro/FileUrl.t b/t/Macro/FileUrl.t index 05df10e4a..ac3dced78 100644 --- a/t/Macro/FileUrl.t +++ b/t/Macro/FileUrl.t @@ -115,7 +115,7 @@ sub setupTest { foreach my $testSet (@testSets) { my $storage = WebGUI::Storage->create($session); - WebGUI::Test->storagesToDelete($storage); + WebGUI::Test->addToCleanup($storage); my $filename = join '.', 'fileName', $testNum; $testSet->{filename} = $filename; diff --git a/t/Macro/Include.t b/t/Macro/Include.t index cf57e7452..c87dc5d58 100644 --- a/t/Macro/Include.t +++ b/t/Macro/Include.t @@ -29,7 +29,7 @@ my $spectreConf = WebGUI::Test->root . '/etc/spectre.conf'; my $goodFile = 'The contents of this file are accessible'; my $twoLines = "This file contains two lines of text\nThis is the second line"; my $storage = WebGUI::Storage->createTemp($session); -WebGUI::Test->storagesToDelete($storage); +WebGUI::Test->addToCleanup($storage); $storage->addFileFromScalar('goodFile', $goodFile); $storage->addFileFromScalar('twoLines', $twoLines); $storage->addFileFromScalar('unreadableFile', 'The contents of this file are not readable'); diff --git a/t/Macro/Thumbnail.t b/t/Macro/Thumbnail.t index 78100d881..0faa5213d 100644 --- a/t/Macro/Thumbnail.t +++ b/t/Macro/Thumbnail.t @@ -35,7 +35,7 @@ $square->setBackgroundColor('#0000FF'); ##Create a storage location my $storage = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($storage); +WebGUI::Test->addToCleanup($storage); ##Save the image to the location $square->saveToStorageLocation($storage, 'square.png'); diff --git a/t/Macro/User.t b/t/Macro/User.t index 33a0decba..6ffb58797 100644 --- a/t/Macro/User.t +++ b/t/Macro/User.t @@ -51,7 +51,7 @@ plan tests => $numTests; @testSets = setupTest($session, @testSets); my @users = map { $_->{user} } @testSets; -WebGUI::Test->usersToDelete(@users); +WebGUI::Test->addToCleanup(@users); foreach my $testSet (@testSets) { $session->user({ userId => $testSet->{user}->userId }); diff --git a/t/Mail/Send.t b/t/Mail/Send.t index ca00fd455..c3736a00f 100644 --- a/t/Mail/Send.t +++ b/t/Mail/Send.t @@ -270,7 +270,7 @@ SKIP: { #---------------------------------------------------------------------------- my $inboxUser = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($inboxUser); +WebGUI::Test->addToCleanup($inboxUser); $inboxUser->username('red'); $inboxUser->profileField('receiveInboxEmailNotifications', 1); $inboxUser->profileField('receiveInboxSmsNotifications', 0); @@ -279,17 +279,17 @@ $inboxUser->profileField('cellPhone', '55555'); $session->setting->set('smsGateway', 'textme.com'); my $emailUser = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($emailUser); +WebGUI::Test->addToCleanup($emailUser); $emailUser->username('heywood'); $emailUser->profileField('email', 'heywood@shawshank.gov'); my $lonelyUser = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($lonelyUser); +WebGUI::Test->addToCleanup($lonelyUser); $lonelyUser->profileField('receiveInboxEmailNotifications', 0); $lonelyUser->profileField('email', 'jake@shawshank.gov'); my $inboxGroup = WebGUI::Group->new($session, 'new'); -WebGUI::Test->groupsToDelete($inboxGroup); +WebGUI::Test->addToCleanup($inboxGroup); $inboxGroup->addUsers([$emailUser->userId, $inboxUser->userId, $lonelyUser->userId]); SKIP: { diff --git a/t/ProfileField.t b/t/ProfileField.t index 2faeaa580..478af2b7b 100644 --- a/t/ProfileField.t +++ b/t/ProfileField.t @@ -28,7 +28,7 @@ use WebGUI::Form::HTMLArea; my $session = WebGUI::Test->session; my $newUser = WebGUI::User->create( $session ); -WebGUI::Test->usersToDelete($newUser); +WebGUI::Test->addToCleanup($newUser); #---------------------------------------------------------------------------- # Tests diff --git a/t/Search.t b/t/Search.t index 932e87560..9c269d03e 100644 --- a/t/Search.t +++ b/t/Search.t @@ -72,7 +72,7 @@ SKIP: { } ); my $tag = WebGUI::VersionTag->getWorking( $session ); $tag->commit; - WebGUI::Test->tagsToRollback($tag); + WebGUI::Test->addToCleanup($tag); WebGUI::Search::Index->create( $article ); my $searcher = WebGUI::Search->new($session); my $assetIds = $searcher->search({ keywords => "Chinese", })->getAssetIds; diff --git a/t/Search/Index.t b/t/Search/Index.t index 09c85df29..ce7972f39 100644 --- a/t/Search/Index.t +++ b/t/Search/Index.t @@ -33,7 +33,7 @@ my $article = WebGUI::Asset->getImportNode( $session )->addChild( { title => 'title', menuTitle => 'menuTitle', } ); -WebGUI::Test->tagsToRollback( +WebGUI::Test->addToCleanup( WebGUI::VersionTag->getWorking( $session ), ); diff --git a/t/Session.t b/t/Session.t index 677284fdb..e956e6acf 100644 --- a/t/Session.t +++ b/t/Session.t @@ -24,7 +24,7 @@ plan tests => 4; # increment this value for each test you create my $session = WebGUI::Test->session; my $user = WebGUI::User->new($session, "new"); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); $session->user({user => $user}); diff --git a/t/Session/DateTime.t b/t/Session/DateTime.t index 84476bd02..3088779fe 100644 --- a/t/Session/DateTime.t +++ b/t/Session/DateTime.t @@ -99,13 +99,13 @@ is ($dt->getTimeZone(), 'America/Chicago', 'getTimeZone: time zones not in the a my $dude = WebGUI::User->new($session, "new"); $dude->profileField('timeZone', 'Australia/Perth'); $session->user({user => $dude}); -WebGUI::Test->usersToDelete($dude); +WebGUI::Test->addToCleanup($dude); is ($dt->getTimeZone(), 'Australia/Perth', 'getTimeZone: valid time zones are allowed'); my $bud = WebGUI::User->new($session, "new"); $bud->profileField('timeZone', ''); $session->user({user => $bud}); -WebGUI::Test->usersToDelete($bud); +WebGUI::Test->addToCleanup($bud); is ($dt->getTimeZone(), 'America/Chicago', q|getTimeZone: if user's time zone doesn't exist, then return America/Chicago|); $session->user({userId => 1}); ##back to Visitor diff --git a/t/Session/ErrorHandler.t b/t/Session/ErrorHandler.t index 3befb145a..4c3b4557c 100644 --- a/t/Session/ErrorHandler.t +++ b/t/Session/ErrorHandler.t @@ -226,7 +226,7 @@ my $showDebug = $eh->showDebug; #################################################### my $newSession = WebGUI::Session->open(WebGUI::Test::root, WebGUI::Test::file); -WebGUI::Test->sessionsToDelete($newSession); +WebGUI::Test->addToCleanup($newSession); my $outputBuffer; open my $outputHandle, '>', \$outputBuffer or die "Unable to create scalar filehandle: $!\n"; $newSession->output->setHandle($outputHandle); diff --git a/t/Shop/AddressBook.t b/t/Shop/AddressBook.t index 47fb2bdea..52d7947e6 100644 --- a/t/Shop/AddressBook.t +++ b/t/Shop/AddressBook.t @@ -220,7 +220,7 @@ undef $book; my $otherSession = WebGUI::Test->newSession; my $mergeUser = WebGUI::User->create($otherSession); -WebGUI::Test->usersToDelete($mergeUser); +WebGUI::Test->addToCleanup($mergeUser); $otherSession->user({user => $mergeUser}); my $adminBook = WebGUI::Shop::AddressBook->create($otherSession); WebGUI::Test->addToCleanup($adminBook); diff --git a/t/Shop/Cart.t b/t/Shop/Cart.t index cc390f009..afaed76a5 100644 --- a/t/Shop/Cart.t +++ b/t/Shop/Cart.t @@ -155,7 +155,7 @@ is($session->db->quickScalar("select count(*) from cartItem where cartId=?",[ $c my $session2 = WebGUI::Session->open(WebGUI::Test->root, WebGUI::Test->file); -WebGUI::Test->sessionsToDelete($session2); +WebGUI::Test->addToCleanup($session2); $session2->user({userId => 3}); my $cart2 = WebGUI::Shop::Cart->newBySession($session2); WebGUI::Test->addToCleanup($cart2); diff --git a/t/Shop/PayDriver/ITransact.t b/t/Shop/PayDriver/ITransact.t index 70e0ee30c..91a12733b 100644 --- a/t/Shop/PayDriver/ITransact.t +++ b/t/Shop/PayDriver/ITransact.t @@ -90,7 +90,7 @@ my $foreignHammer = $rockHammer->setCollateral('variantsJSON', 'variantId', 'new $versionTag->commit; -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); my $hammerItem = $rockHammer->addToCart($rockHammer->getCollateral('variantsJSON', 'variantId', $smallHammer)); diff --git a/t/Shop/ShipDriver/UPS.t b/t/Shop/ShipDriver/UPS.t index 9a04dbfab..ccc95c8ca 100644 --- a/t/Shop/ShipDriver/UPS.t +++ b/t/Shop/ShipDriver/UPS.t @@ -33,7 +33,7 @@ use Locales; # Init my $session = WebGUI::Test->session; my $user = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); $session->user({user => $user}); #---------------------------------------------------------------------------- diff --git a/t/Shop/ShipDriver/USPS.t b/t/Shop/ShipDriver/USPS.t index 049c75b2b..9435794aa 100644 --- a/t/Shop/ShipDriver/USPS.t +++ b/t/Shop/ShipDriver/USPS.t @@ -31,7 +31,7 @@ plan tests => 69; # Init my $session = WebGUI::Test->session; my $user = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); $session->user({user => $user}); #---------------------------------------------------------------------------- diff --git a/t/Shop/ShipDriver/USPSInternational.t b/t/Shop/ShipDriver/USPSInternational.t index b2d3b07c1..e94d4b3d9 100644 --- a/t/Shop/ShipDriver/USPSInternational.t +++ b/t/Shop/ShipDriver/USPSInternational.t @@ -31,7 +31,7 @@ plan tests => 40; # Init my $session = WebGUI::Test->session; my $user = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); $session->user({user => $user}); #---------------------------------------------------------------------------- diff --git a/t/Shop/TaxDriver/EU.t b/t/Shop/TaxDriver/EU.t index 061a3f0fd..8ac141717 100644 --- a/t/Shop/TaxDriver/EU.t +++ b/t/Shop/TaxDriver/EU.t @@ -37,7 +37,7 @@ my $session = WebGUI::Test->session; my $taxUser = WebGUI::User->new( $session, 'new' ); $taxUser->username( 'Tex Evasion' ); $session->user({userId => $taxUser->getId}); -WebGUI::Test->usersToDelete($taxUser); +WebGUI::Test->addToCleanup($taxUser); # Test VAT numbers my $testVAT_NL = 'NL123456789B12'; diff --git a/t/Shop/Vendor.t b/t/Shop/Vendor.t index 19a5dc481..cccc56c0d 100644 --- a/t/Shop/Vendor.t +++ b/t/Shop/Vendor.t @@ -44,7 +44,7 @@ my $fenceUser = WebGUI::User->new($session, 'new'); $fenceUser->username('fence'); my $guardUser = WebGUI::User->new($session, 'new'); $guardUser->username('guard'); -WebGUI::Test->usersToDelete($fenceUser, $guardUser); +WebGUI::Test->addToCleanup($fenceUser, $guardUser); $numberOfVendors = scalar @{ WebGUI::Shop::Vendor->getVendors($session) }; diff --git a/t/Storage/Image.t b/t/Storage/Image.t index 70a0603e0..aae27dddd 100644 --- a/t/Storage/Image.t +++ b/t/Storage/Image.t @@ -82,7 +82,7 @@ ok ($uploadUrl, "uploadDir defined in config"); #################################################### my $imageStore = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($imageStore); +WebGUI::Test->addToCleanup($imageStore); my $expectedFiles = ['.', ]; cmp_bag($imageStore->getFiles(1), $expectedFiles, 'Starting with an empty storage object, no files in here except for . and ..'); $imageStore->addFileFromScalar('.dotfile', 'dot file'); @@ -119,7 +119,7 @@ foreach my $extTest ( @{ $extensionTests } ) { WebGUI::Test->interceptLogging(); my $thumbStore = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($thumbStore); +WebGUI::Test->addToCleanup($thumbStore); my $square = WebGUI::Image->new($session, 500, 500); $square->setBackgroundColor('#FF0000'); $square->saveToStorageLocation($thumbStore, 'square.png'); @@ -170,7 +170,7 @@ like($WebGUI::Test::logger_error, qr/^Couldn't read image to check the size of i #################################################### my $imageCopy = $thumbStore->copy(); -WebGUI::Test->storagesToDelete($imageCopy); +WebGUI::Test->addToCleanup($imageCopy); isa_ok($imageCopy, 'WebGUI::Storage', 'copy returns an object'); cmp_bag( $imageCopy->getFiles(), @@ -219,7 +219,7 @@ is($thumbStore->getThumbnailUrl('square.png'), $thumbStore->getUrl('thumb-square my $origMaxImageSize = $session->setting->get('maxImageSize'); my $sizeTest = WebGUI::Storage->create($session); -WebGUI::Test->storagesToDelete($sizeTest); +WebGUI::Test->addToCleanup($sizeTest); my $resizeTarget = 80; $session->setting->set('maxImageSize', 200 ); @@ -284,7 +284,7 @@ $session->setting->set('maxImageSize', $origMaxImageSize ); #################################################### my $rotateTest = WebGUI::Storage->create( $session ); -WebGUI::Test->storagesToDelete($rotateTest); +WebGUI::Test->addToCleanup($rotateTest); # Add test image to the storage ok( $rotateTest->addFileFromFilesystem(WebGUI::Test->getTestCollateralPath("rotation_test.png")), "Can add test image to storage" ); diff --git a/t/User.t b/t/User.t index dd324c1a0..e7aa39d19 100644 --- a/t/User.t +++ b/t/User.t @@ -37,7 +37,7 @@ my $lastUpdate; #Let's try to create a new user and make sure we get an object back my $userCreationTime = time(); ok(defined ($user = WebGUI::User->new($session,"new")), 'new("new") -- object reference is defined'); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); #New does not return undef if something breaks, so we'll see if the _profile hash was set. ok(exists $user->{_profile}, 'new("new") -- profile subhash exists'); @@ -412,7 +412,7 @@ $cm->ipFilter(defined $origFilter ? $origFilter : ''); ##Test for group membership $user = WebGUI::User->new($session, "new"); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); ok($user->isInGroup(7), "addToGroups: New user is in group 7(Everyone)"); ok(!$user->isInGroup(1), "New user not in group 1 (Visitors)"); ok($user->isRegistered, "User is not a visitor"); @@ -467,7 +467,7 @@ ok($visitor->isInGroup(7), "Visitor added back to group Everyone"); ################################################################ my $dude = WebGUI::User->new($session, "new"); -WebGUI::Test->usersToDelete($dude); +WebGUI::Test->addToCleanup($dude); ok(!$dude->canUseAdminMode, 'canUseAdminMode: newly created users cannot'); @@ -566,7 +566,7 @@ is($useru->userId, $dude->userId, '... and it is the right user object'); ################################################################ my $buster = WebGUI::User->new($session, "new"); -WebGUI::Test->usersToDelete($buster); +WebGUI::Test->addToCleanup($buster); is( $buster->profileField('timeZone'), 'America/Chicago', 'buster received original user profile on user creation'); my $profileField = WebGUI::ProfileField->new($session, 'timeZone'); @@ -595,7 +595,7 @@ $copiedAliasProfile{'dataDefault'} = "'aliasAlias'"; ##Non word characters; $aliasProfile->set(\%copiedAliasProfile); my $buster3 = WebGUI::User->new($session, $buster->userId); -WebGUI::Test->usersToDelete($buster); +WebGUI::Test->addToCleanup($buster); is($buster3->profileField('alias'), 'aliasAlias', 'default alias set'); $copiedAliasProfile{'dataDefault'} = "'....^^^^....'"; ##Non word characters; @@ -642,7 +642,7 @@ is($session->scratch->get('hack'), undef, 'userProfile dataDefault is not execut ##Set up a group that has expired. my $expiredGroup = WebGUI::Group->new($session, 'new'); -WebGUI::Test->groupsToDelete($expiredGroup); +WebGUI::Test->addToCleanup($expiredGroup); $expiredGroup->name('Group that expires users automatically'); $expiredGroup->expireOffset(-1000); @@ -671,7 +671,7 @@ cmp_bag($dude->getGroups(1), [2, 7], 'Accessing the cached list of groups does n ################################################################ my $friend = WebGUI::User->new($session, 'new'); -WebGUI::Test->usersToDelete($friend); +WebGUI::Test->addToCleanup($friend); is($friend->getFirstName, undef, 'with no profile settings, getFirstName returns undef'); $friend->username('friend'); @@ -688,7 +688,7 @@ is($friend->getFirstName, 'Mr', 'firstName is the highest priority profile setti ################################################################ my $neighbor = WebGUI::User->new($session, 'new'); -WebGUI::Test->usersToDelete($neighbor); +WebGUI::Test->addToCleanup($neighbor); is($neighbor->getWholeName, undef, 'with no profile settings, getWholeName returns undef'); $neighbor->username('neighbor'); @@ -780,7 +780,7 @@ foreach my $groupName (qw/red pink orange blue turquoise lightBlue purple/) { $groupSet{$groupName} = WebGUI::Group->new($session, 'new'); $groupSet{$groupName}->name($groupName); } -WebGUI::Test->groupsToDelete(values %groupSet); +WebGUI::Test->addToCleanup(values %groupSet); $groupSet{blue}->expireOffset(-1500); @@ -791,7 +791,7 @@ $groupSet{pink}->addGroups( [ map { $groupSet{$_}->getId } qw/red/ ] ); $groupSet{orange}->addGroups( [ map { $groupSet{$_}->getId } qw/red/ ] ); my $newFish = WebGUI::User->new($session, 'new'); -WebGUI::Test->usersToDelete($newFish); +WebGUI::Test->addToCleanup($newFish); $newFish->addToGroups([ $groupSet{red}->getId, $groupSet{blue}->getId ]); cmp_bag( @@ -825,7 +825,7 @@ SKIP: { ok( my $newCreateUser = WebGUI::User->create( $session ), 'create() returns something' ); -WebGUI::Test->usersToDelete($newCreateUser); +WebGUI::Test->addToCleanup($newCreateUser); isa_ok( $newCreateUser, 'WebGUI::User', 'create() returns a WebGUI::User' ); ################################################################ @@ -988,7 +988,7 @@ $friend->deleteFromGroups([$neighbor->friends->getId]); $session->setting->set('smsGateway', ''); my $inmate = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($inmate); +WebGUI::Test->addToCleanup($inmate); $inmate->profileField('email', ''); $inmate->profileField('cellPhone', ''); $inmate->profileField('receiveInboxEmailNotifications', 0); @@ -1041,7 +1041,7 @@ is($inmate->getInboxSmsNotificationAddress, '5555555555@textme.com', '... strips ##Specifically, cleaning up Address books my $shopUser = WebGUI::User->create($session); -WebGUI::Test->usersToDelete($shopUser); +WebGUI::Test->addToCleanup($shopUser); $session->user({user => $shopUser}); my $book = WebGUI::Shop::AddressBook->create($session); is ($book->get('userId'), $shopUser->userId, 'delete: Address book created with proper user'); diff --git a/t/VersionTag.t b/t/VersionTag.t index 606700543..ea7ee7aac 100644 --- a/t/VersionTag.t +++ b/t/VersionTag.t @@ -261,7 +261,7 @@ is($siteWideTag->getId(), $siteWideTagId, 'versionTagMode siteWide: reclaim site ## Through in a new session as different user my $admin_session = WebGUI::Session->open($WebGUI::Test::WEBGUI_ROOT, $WebGUI::Test::CONFIG_FILE); $admin_session->user({'userId' => 3}); -WebGUI::Test->sessionsToDelete($admin_session); +WebGUI::Test->addToCleanup($admin_session); setUserVersionTagMode($admin_session->user(), q{singlePerUser}); @@ -325,7 +325,7 @@ $adminUserTag->rollback(); # create admin session my $admin_session = WebGUI::Session->open($WebGUI::Test::WEBGUI_ROOT, $WebGUI::Test::CONFIG_FILE); - WebGUI::Test->sessionsToDelete($admin_session); + WebGUI::Test->addToCleanup($admin_session); $admin_session->user({'userId' => 3}); setUserVersionTagMode($admin_session->user(), q{autoCommit}); @@ -377,7 +377,7 @@ $adminUserTag->rollback(); # create admin session $admin_session = WebGUI::Session->open($WebGUI::Test::WEBGUI_ROOT, $WebGUI::Test::CONFIG_FILE); - WebGUI::Test->sessionsToDelete($admin_session); + WebGUI::Test->addToCleanup($admin_session); $admin_session->user({'userId' => 3}); setUserVersionTagMode($admin_session->user(), q{autoCommit}); diff --git a/t/Workflow/Activity/CalendarUpdateFeeds.t b/t/Workflow/Activity/CalendarUpdateFeeds.t index 6d8cbd84f..9f97f5e7c 100644 --- a/t/Workflow/Activity/CalendarUpdateFeeds.t +++ b/t/Workflow/Activity/CalendarUpdateFeeds.t @@ -65,7 +65,7 @@ my $party = $sender->addChild({ my $tag = WebGUI::VersionTag->getWorking($session); $tag->commit; -WebGUI::Test->tagsToRollback($tag); +WebGUI::Test->addToCleanup($tag); my $workflow = WebGUI::Workflow->create($session, { diff --git a/t/Workflow/Activity/ExpireIncompleteSurveyResponses.t b/t/Workflow/Activity/ExpireIncompleteSurveyResponses.t index c187a3fe0..4df709ee2 100644 --- a/t/Workflow/Activity/ExpireIncompleteSurveyResponses.t +++ b/t/Workflow/Activity/ExpireIncompleteSurveyResponses.t @@ -26,19 +26,19 @@ my $wf = WebGUI::Workflow->create($session, { mode => 'realtime', }); isa_ok($wf, 'WebGUI::Workflow', 'Test workflow'); -WebGUI::Test->workflowsToDelete($wf); +WebGUI::Test->addToCleanup($wf); my $activity = $wf->addActivity('WebGUI::Workflow::Activity::ExpireIncompleteSurveyResponses'); isa_ok($activity, 'WebGUI::Workflow::Activity::ExpireIncompleteSurveyResponses', 'Test wf activity'); $activity->set('title', 'Test Expire Incomplete Survey Responses'); my $user = WebGUI::User->new($session, 'new'); -WebGUI::Test->usersToDelete($user); +WebGUI::Test->addToCleanup($user); # Create a Survey my $survey = WebGUI::Asset->getImportNode($session)->addChild( { className => 'WebGUI::Asset::Wobject::Survey', } ); -WebGUI::Test->tagsToRollback(WebGUI::VersionTag->getWorking($session)); -WebGUI::Test->assetsToPurge($survey); +WebGUI::Test->addToCleanup(WebGUI::VersionTag->getWorking($session)); +WebGUI::Test->addToCleanup($survey); my $sJSON = $survey->surveyJSON; $sJSON->newObject([0]); # add a question to 0th section $sJSON->update([0,0], { questionType => 'Yes/No' }); @@ -118,7 +118,7 @@ is( scalar $session->db->buildArray($SQL), 0, 'Afterwards, back to no incomplete # Create a new revision $survey->addRevision({}, time+1); -WebGUI::Test->tagsToRollback(WebGUI::VersionTag->getWorking($session)); +WebGUI::Test->addToCleanup(WebGUI::VersionTag->getWorking($session)); # Undo out handiwork again is($session->db->quickScalar('select count(*) from Survey_response where Survey_responseId = ?', [$responseId]), 1, 'Start off with 1 response'); diff --git a/t/Workflow/Activity/RemoveOldCarts.t b/t/Workflow/Activity/RemoveOldCarts.t index ec05b6e33..b6b946d31 100644 --- a/t/Workflow/Activity/RemoveOldCarts.t +++ b/t/Workflow/Activity/RemoveOldCarts.t @@ -33,14 +33,14 @@ my $donation = $root->addChild({ }); my $tag = WebGUI::VersionTag->getWorking($session); $tag->commit; -WebGUI::Test->tagsToRollback($tag); +WebGUI::Test->addToCleanup($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); +WebGUI::Test->addToCleanup($session2); my $cart2 = WebGUI::Shop::Cart->create($session2); $cart2->update({creationDate => time()-10000}); diff --git a/t/Workflow/Activity/SendNewsletters.t b/t/Workflow/Activity/SendNewsletters.t index 9f7aa56f5..2ea37884e 100644 --- a/t/Workflow/Activity/SendNewsletters.t +++ b/t/Workflow/Activity/SendNewsletters.t @@ -70,7 +70,7 @@ my $thread = $cs->addChild({ }, undef, undef, {skipAutoCommitWorkflows => 1,}); $versionTag->commit; -WebGUI::Test->tagsToRollback($versionTag); +WebGUI::Test->addToCleanup($versionTag); ##Setup metadata $session->setting->set('metaDataEnabled', 1); @@ -84,7 +84,7 @@ $thread->updateMetaData($metaDataFields->{newsletterCategory}, 'Andy'); ##Create subscriber user my $subscriber = WebGUI::User->create($session); $subscriber->update({ 'email', 'going@nowhere.com' }); -WebGUI::Test->usersToDelete($subscriber); +WebGUI::Test->addToCleanup($subscriber); $cs->setUserSubscriptions($metaDataFields->{newsletterCategory}."~Andy", $subscriber->getId); $session->db->write(<getId, $subscriber->getId ]); update Newsletter_subscriptions set lastTimeSent=? where assetId=? and userId=? diff --git a/t/Workflow/Activity/TrashExpiredEvents.t b/t/Workflow/Activity/TrashExpiredEvents.t index 04ce3c844..a89534965 100644 --- a/t/Workflow/Activity/TrashExpiredEvents.t +++ b/t/Workflow/Activity/TrashExpiredEvents.t @@ -66,7 +66,7 @@ my $nowEvent = $calendar->addChild({ my $tag = WebGUI::VersionTag->getWorking($session); $tag->commit; -WebGUI::Test->tagsToRollback($tag); +WebGUI::Test->addToCleanup($tag); my $workflow = WebGUI::Workflow->create($session, { diff --git a/t/lib/WebGUI/Test.pm b/t/lib/WebGUI/Test.pm index 0a04ca677..4e91a724c 100644 --- a/t/lib/WebGUI/Test.pm +++ b/t/lib/WebGUI/Test.pm @@ -649,40 +649,6 @@ sub getMailFromQueue { #---------------------------------------------------------------------------- -=head2 sessionsToDelete ( $session, [$session, ...] ) - -Push a list of session objects onto the stack of groups to be automatically deleted -at the end of the test. Note, this will be the last group of objects to be -cleaned up. - -This is a class method. - -=cut - -sub sessionsToDelete { - my $class = shift; - $class->addToCleanup(@_); -} - -#---------------------------------------------------------------------------- - -=head2 assetsToPurge ( $asset, [$asset ] ) - -Push a list of Asset objects onto the stack of assets to be automatically purged -at the end of the test. This will also clean-up all version tags associated -with the Asset. - -This is a class method. - -=cut - -sub assetsToPurge { - my $class = shift; - $class->addToCleanup(@_); -} - -#---------------------------------------------------------------------------- - =head2 cleanupAdminInbox ( ) Push a list of Asset objects onto the stack of assets to be automatically purged @@ -700,89 +666,6 @@ sub cleanupAdminInbox { $inbox->deleteMessagesForUser($admin); } -#---------------------------------------------------------------------------- - -=head2 groupsToDelete ( $group, [$group ] ) - -Push a list of group objects onto the stack of groups to be automatically deleted -at the end of the test. - -This is a class method. - -=cut - -sub groupsToDelete { - my $class = shift; - $class->addToCleanup(@_); -} - - -#---------------------------------------------------------------------------- - -=head2 storagesToDelete ( $storage, [$storageId ] ) - -Push a list of storage objects or storageIds onto the stack of storage locaitons -at the end of the test. - -This is a class method. - -=cut - -sub storagesToDelete { - my $class = shift; - $class->addToCleanup(map { - ref $_ ? $_ : ('WebGUI::Storage' => $_) - } @_); -} - -#---------------------------------------------------------------------------- - -=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; - $class->addToCleanup(@_); -} - -#---------------------------------------------------------------------------- - -=head2 usersToDelete ( $user, [$user, ...] ) - -Push a list of user objects onto the stack of groups to be automatically deleted -at the end of the test. If found in the stack, the Admin and Visitor users will not be deleted. - -This is a class method. - -=cut - -sub usersToDelete { - my $class = shift; - $class->addToCleanup(@_); -} - -#---------------------------------------------------------------------------- - -=head2 workflowsToDelete ( $workflow, [$workflow, ...] ) - -Push a list of workflow objects onto the stack of groups to be automatically deleted -at the end of the test. - -This is a class method. - -=cut - -sub workflowsToDelete { - my $class = shift; - $class->addToCleanup(@_); -} - - #---------------------------------------------------------------------------- =head2 cleanupGuard ( $object, $class => $ident )