Deprecated WebGUI::Storage::Image. WebGUI::Storage can now do everything
WebGUI::Storage::Image can do.
This commit is contained in:
parent
2b3e88fd63
commit
ee84cc7611
34 changed files with 399 additions and 470 deletions
|
|
@ -87,7 +87,7 @@ my $fileStorage = WebGUI::Storage->create($session);
|
|||
$mocker->set_always('getValue', $fileStorage->getId);
|
||||
my $fileFormStorage = $asset->getStorageFromPost();
|
||||
isa_ok($fileFormStorage, 'WebGUI::Storage', 'Asset::File::getStorageFromPost');
|
||||
isnt(ref $fileFormStorage, 'WebGUI::Storage::Image', 'getStorageFromPost does not return an image storage object');
|
||||
isnt(ref $fileFormStorage, 'WebGUI::Storage', 'getStorageFromPost does not return an image storage object');
|
||||
|
||||
END {
|
||||
if (defined $versionTag and ref $versionTag eq 'WebGUI::VersionTag') {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ BEGIN {
|
|||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Image;
|
||||
use WebGUI::Storage::Image;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::Asset::File::Image;
|
||||
use WebGUI::Form::File;
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ my $square = WebGUI::Image->new($session, 100, 100);
|
|||
$square->setBackgroundColor('#0000FF');
|
||||
|
||||
##Create a storage location
|
||||
my $storage = WebGUI::Storage::Image->create($session);
|
||||
my $storage = WebGUI::Storage->create($session);
|
||||
|
||||
##Save the image to the location
|
||||
$square->saveToStorageLocation($storage, 'square.png');
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ use WebGUI::Test; # Must use this before any other WebGUI modules
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::Asset::Sku::Product;
|
||||
use WebGUI::Storage::Image;
|
||||
use WebGUI::Storage;
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Init
|
||||
|
|
@ -47,7 +47,7 @@ my $product = $node->addChild({
|
|||
|
||||
is($product->getThumbnailUrl(), '', 'Product with no image1 property returns the empty string');
|
||||
|
||||
my $image = WebGUI::Storage::Image->create($session);
|
||||
my $image = WebGUI::Storage->create($session);
|
||||
$image->addFileFromFilesystem(WebGUI::Test->getTestCollateralPath('lamp.jpg'));
|
||||
|
||||
my $imagedProduct = $node->addChild({
|
||||
|
|
@ -60,7 +60,7 @@ my $imagedProduct = $node->addChild({
|
|||
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::Image->create($session);
|
||||
my $otherImage = WebGUI::Storage->create($session);
|
||||
$otherImage->addFileFromFilesystem(WebGUI::Test->getTestCollateralPath('gooey.jpg'));
|
||||
|
||||
ok($imagedProduct->getThumbnailUrl($otherImage), 'getThumbnailUrl with an explicit storageId returns something');
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ my $filename = "page_title.jpg";
|
|||
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::Image->create($session);
|
||||
my $storage = WebGUI::Storage->create($session);
|
||||
my $storedFilename = $storage->addFileFromFilesystem($pathedFile);
|
||||
my $filenameOK = is ($storedFilename, $filename, 'storage created correctly');
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ my $duplicateArticle = $article->duplicate();
|
|||
isa_ok($duplicateArticle, 'WebGUI::Asset::Wobject::Article');
|
||||
|
||||
my $duplicateStorageId = $duplicateArticle->get("storageId");
|
||||
my $duplicateStorage = WebGUI::Storage::Image->get($session,$duplicateStorageId);
|
||||
my $duplicateStorage = WebGUI::Storage->get($session,$duplicateStorageId);
|
||||
my $duplicateFilename = $duplicateStorage->getFiles->[0];
|
||||
|
||||
is ($duplicateFilename, $filename, "duplicate method copies collateral");
|
||||
|
|
@ -96,7 +96,7 @@ is ($duplicateFilename, $filename, "duplicate method copies collateral");
|
|||
$duplicateArticle->purge();
|
||||
|
||||
# The get method will create the directory if it doesnt exist... very strange.
|
||||
$duplicateStorage = WebGUI::Storage::Image->get($session,$duplicateStorageId);
|
||||
$duplicateStorage = WebGUI::Storage->get($session,$duplicateStorageId);
|
||||
|
||||
# so lets check for the file instead
|
||||
$duplicateFilename = $duplicateStorage->getFiles->[0];
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ my $filename = "page_title.jpg";
|
|||
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::Image->create($session);
|
||||
my $storage = WebGUI::Storage->create($session);
|
||||
my $storedFilename = $storage->addFileFromFilesystem($pathedFile);
|
||||
my $filenameOK = is ($storedFilename, $filename, 'storage created correctly');
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ my $duplicateArticle = $article->duplicate();
|
|||
isa_ok($duplicateArticle, 'WebGUI::Asset::Wobject::Article');
|
||||
|
||||
my $duplicateStorageId = $duplicateArticle->get("storageId");
|
||||
my $duplicateStorage = WebGUI::Storage::Image->get($session,$duplicateStorageId);
|
||||
my $duplicateStorage = WebGUI::Storage->get($session,$duplicateStorageId);
|
||||
my $duplicateFilename = $duplicateStorage->getFiles->[0];
|
||||
|
||||
is ($duplicateFilename, $filename, "duplicate method copies collateral");
|
||||
|
|
@ -96,7 +96,7 @@ is ($duplicateFilename, $filename, "duplicate method copies collateral");
|
|||
$duplicateArticle->purge();
|
||||
|
||||
# The get method will create the directory if it doesnt exist... very strange.
|
||||
$duplicateStorage = WebGUI::Storage::Image->get($session,$duplicateStorageId);
|
||||
$duplicateStorage = WebGUI::Storage->get($session,$duplicateStorageId);
|
||||
|
||||
# so lets check for the file instead
|
||||
$duplicateFilename = $duplicateStorage->getFiles->[0];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue