convert all test cleanup to addToCleanup
This commit is contained in:
parent
421b9652cf
commit
4c18ba3563
82 changed files with 190 additions and 307 deletions
|
|
@ -57,7 +57,7 @@ foreach my $file_property (qw/image1 image2 image3 brochure manual warranty/) {
|
|||
}
|
||||
|
||||
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');
|
||||
|
||||
|
|
@ -72,7 +72,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');
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ cmp_deeply(
|
|||
|
||||
my $tag = WebGUI::VersionTag->getWorking($session);
|
||||
$tag->commit;
|
||||
WebGUI::Test->tagsToRollback($tag);
|
||||
WebGUI::Test->addToCleanup($tag);
|
||||
|
||||
####################################################
|
||||
#
|
||||
|
|
@ -132,7 +132,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;
|
||||
|
||||
####################################################
|
||||
|
|
@ -169,7 +169,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->newById($session, $viewProduct->getId);
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue