convert all cleanup methods to addToCleanup
This commit is contained in:
parent
0ef509374f
commit
b832deecd1
86 changed files with 198 additions and 315 deletions
|
|
@ -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" );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue