Commit the workflow.

Use the skipAutoCommitWorkflow switch.
AssetTrash->purge does not set the invocant to be undef, only its copy.
This commit is contained in:
Colin Kuskie 2007-12-21 17:51:24 +00:00
parent 1cd0b0be34
commit cf00f5bb5b

View file

@ -10,7 +10,7 @@
use FindBin; use FindBin;
use strict; use strict;
use lib "$FindBin::Bin/../../../../lib"; use lib "$FindBin::Bin/../../../lib";
## The goal of this test is to test the creation and deletion of album assets ## The goal of this test is to test the creation and deletion of album assets
@ -30,19 +30,12 @@ my $gallery
className => "WebGUI::Asset::Wobject::Gallery", className => "WebGUI::Asset::Wobject::Gallery",
}); });
#----------------------------------------------------------------------------
# Cleanup
END {
$versionTag->rollback();
}
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Tests # Tests
plan tests => 5; plan tests => 4;
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Test module compiles okay # Test module compiles okay
# plan tests => 1
use_ok("WebGUI::Asset::Wobject::GalleryAlbum"); use_ok("WebGUI::Asset::Wobject::GalleryAlbum");
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
@ -50,8 +43,15 @@ use_ok("WebGUI::Asset::Wobject::GalleryAlbum");
my $album my $album
= $gallery->addChild({ = $gallery->addChild({
className => "WebGUI::Asset::Wobject::GalleryAlbum", className => "WebGUI::Asset::Wobject::GalleryAlbum",
},
undef,
undef,
{
skipAutoCommitWorkflows => 1,
}); });
$versionTag->commit;
is( is(
blessed $album, "WebGUI::Asset::Wobject::GalleryAlbum", blessed $album, "WebGUI::Asset::Wobject::GalleryAlbum",
"Album is a WebGUI::Asset::Wobject::GalleryAlbum object", "Album is a WebGUI::Asset::Wobject::GalleryAlbum object",
@ -66,13 +66,14 @@ isa_ok(
my $properties = $album->get; my $properties = $album->get;
$album->purge; $album->purge;
is(
$album, undef,
"Album is undefined",
);
is( is(
WebGUI::Asset->newByDynamicClass($session, $properties->{assetId}), undef, WebGUI::Asset->newByDynamicClass($session, $properties->{assetId}), undef,
"Album no longer able to be instanciated", "Album no longer able to be instanciated",
); );
#----------------------------------------------------------------------------
# Cleanup
END {
$versionTag->rollback();
}