diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 15ab292e0..249def051 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -29,6 +29,7 @@ directory. - Added a Sync Profile to LDAP workflow activity that will grab a single user profile from LDAP instead of all of them. + - fix: Article.t copy collateral test false failure. 7.0.9 - Removed the need for DateTime::Cron::Simple, which also added the ability diff --git a/t/Asset/Wobject/Article.t b/t/Asset/Wobject/Article.t index 064c3481b..6ec5de769 100644 --- a/t/Asset/Wobject/Article.t +++ b/t/Asset/Wobject/Article.t @@ -55,7 +55,7 @@ my $newArticleSettings = { templateId => "PBtmpl0000000000000084", linkURL => "http://www.snapcount.org", linkTitle => "I'm thinking of getting metal legs", - storageId => "FKGH2yiNQoC2E_FqbMYebw", # This is the storageId of main_bg.jpg from the default wg 7 style 3 + storageId => "ImadeThisUp", }; $article->update($newArticleSettings); @@ -64,23 +64,39 @@ foreach my $newSetting (keys %{$newArticleSettings}) { } # Test the duplicate method... not for assets, just the extended duplicate functionality of the article wobject -my $filename = "main_bg.jpg"; +my $filename = "page_title.jpg"; + +# Use some test collateral to create a storage location and assign it to our article +my $storage = WebGUI::Storage::Image->create($session); +$storage->addFileFromFilesystem("../../supporting_collateral/".$filename); +$article->update({storageId=>$storage->getId}); my $duplicateArticle = $article->duplicate(); isa_ok($duplicateArticle, 'WebGUI::Asset::Wobject::Article'); -my $storageId = $duplicateArticle->get("storageId"); -my $storage = WebGUI::Storage::Image->get($session,$storageId); -my $duplicateFilename = $storage->getFiles->[0]; +my $duplicateStorageId = $duplicateArticle->get("storageId"); +my $duplicateStorage = WebGUI::Storage::Image->get($session,$duplicateStorageId); +my $duplicateFilename = $duplicateStorage->getFiles->[0]; is ($duplicateFilename, $filename, "duplicate method copies collateral"); +# Test the purge method to see if it gets rid of the collateral + +$duplicateArticle->purge(); + +# The get method will create the directory if it doesnt exist... very strange. +$duplicateStorage = WebGUI::Storage::Image->get($session,$duplicateStorageId); + +# so lets check for the file instead +$duplicateFilename = $duplicateStorage->getFiles->[0]; + +is ($duplicateFilename, undef, 'purge method deletes collateral'); + TODO: { local $TODO = "Tests to make later"; ok(0, 'Test exportAssetData method'); ok(0, 'Test getStorageLocation method'); ok(0, 'Test indexContent method'); - ok(0, 'Test purge method'); ok(0, 'Test purgeCache method'); ok(0, 'Test purgeRevision method'); ok(0, 'Test view method... maybe?'); diff --git a/t/supporting_collateral/page_title.jpg b/t/supporting_collateral/page_title.jpg new file mode 100644 index 000000000..8b8159f80 Binary files /dev/null and b/t/supporting_collateral/page_title.jpg differ