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:
parent
1cd0b0be34
commit
cf00f5bb5b
1 changed files with 15 additions and 14 deletions
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
use FindBin;
|
||||
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
|
||||
|
||||
|
|
@ -30,19 +30,12 @@ my $gallery
|
|||
className => "WebGUI::Asset::Wobject::Gallery",
|
||||
});
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Cleanup
|
||||
END {
|
||||
$versionTag->rollback();
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Tests
|
||||
plan tests => 5;
|
||||
plan tests => 4;
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Test module compiles okay
|
||||
# plan tests => 1
|
||||
use_ok("WebGUI::Asset::Wobject::GalleryAlbum");
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -50,8 +43,15 @@ use_ok("WebGUI::Asset::Wobject::GalleryAlbum");
|
|||
my $album
|
||||
= $gallery->addChild({
|
||||
className => "WebGUI::Asset::Wobject::GalleryAlbum",
|
||||
},
|
||||
undef,
|
||||
undef,
|
||||
{
|
||||
skipAutoCommitWorkflows => 1,
|
||||
});
|
||||
|
||||
$versionTag->commit;
|
||||
|
||||
is(
|
||||
blessed $album, "WebGUI::Asset::Wobject::GalleryAlbum",
|
||||
"Album is a WebGUI::Asset::Wobject::GalleryAlbum object",
|
||||
|
|
@ -66,13 +66,14 @@ isa_ok(
|
|||
my $properties = $album->get;
|
||||
$album->purge;
|
||||
|
||||
is(
|
||||
$album, undef,
|
||||
"Album is undefined",
|
||||
);
|
||||
|
||||
is(
|
||||
WebGUI::Asset->newByDynamicClass($session, $properties->{assetId}), undef,
|
||||
"Album no longer able to be instanciated",
|
||||
);
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Cleanup
|
||||
END {
|
||||
$versionTag->rollback();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue