From 1cd0b0be34a5a084391d70ca2ab8bc400a1d95d7 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 21 Dec 2007 17:49:52 +0000 Subject: [PATCH] Adding a basic AssetTrash test to quickly check the purge method. --- t/Asset/AssetTrash.t | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 t/Asset/AssetTrash.t diff --git a/t/Asset/AssetTrash.t b/t/Asset/AssetTrash.t new file mode 100644 index 000000000..7be661ae6 --- /dev/null +++ b/t/Asset/AssetTrash.t @@ -0,0 +1,53 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2007 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use FindBin; +use strict; +use lib "$FindBin::Bin/../lib"; + +use WebGUI::Test; +use WebGUI::Session; +use WebGUI::User; + +use WebGUI::Asset; +use Test::More tests => 1; # increment this value for each test you create +use Test::Deep; + +# Test the methods in WebGUI::AssetLineage + +my $session = WebGUI::Test->session; + +my $versionTag = WebGUI::VersionTag->getWorking($session); +$versionTag->set({name=>"AssetLineage Test"}); + +my $root = WebGUI::Asset->getRoot($session); +my $topFolder = $root->addChild({ + url => 'TopFolder', + title => 'TopFolder', + menuTitle => 'topFolderMenuTitle', + groupIdEdit => 3, + className => 'WebGUI::Asset::Wobject::Folder', +}); + +$versionTag->commit; + +#################################################### +# +# purge +# +#################################################### + +is($topFolder->purge, 1, 'purge returns 1 if asset can be purged'); + +END { + foreach my $tag ($versionTag) { + $tag->rollback; + } +}