Batch of test cleaups for leaking objects.

This commit is contained in:
Colin Kuskie 2011-04-04 16:06:49 -07:00
parent 28e4f9f245
commit 73261e4651
6 changed files with 7 additions and 8 deletions

View file

@ -214,20 +214,22 @@ my $process = Test::MockObject::Extends->new( 'WebGUI::Fork' );
$process->mock( "update" => sub { } ); # do nothing on update. we don't care
$process->mock( "session" => sub { return $session } );
# Try with a Collaboration and some Threads
my $tag = WebGUI::VersionTag->getWorking( $session );
WebGUI::Test->addToCleanup($tag);
my $collab = $tempspace->addChild({
className => 'WebGUI::Asset::Wobject::Collaboration',
groupIdEdit => "3",
status => "pending",
tagId => $tag->getId,
});
}, undef, undef, { skipAutoCommitWorkflows => 1, skipNotification => 1 });
my $thread = $collab->addChild({
className => 'WebGUI::Asset::Post::Thread',
groupIdEdit => "3",
status => "pending",
tagId => $tag->getId,
}, undef, undef, { skipAutoCommitWorkflows => 1 });
}, undef, undef, { skipAutoCommitWorkflows => 1, skipNotification => 1 });
$tag->commit;
$thread->cut;
WebGUI::Asset::pasteInFork( $process, { assetId => $collab->getId, list => [ $thread->getId ] } );

View file

@ -124,7 +124,6 @@ cmp_deeply(
my $newRev = $asset->addRevision( { groupIdView => '7' }, time + 8 );
WebGUI::Test::addToCleanup( WebGUI::VersionTag->getWorking( $session ) );
is( $newRev->getStorageLocation->getFileContentsAsScalar('.wgaccess'), undef, "wgaccess doesn't exist" );
note( @{ $newRev->getStorageLocation->getFiles() } );
#----------------------------------------------------------------------------
# commit on new revision trashes old revision

View file

@ -54,7 +54,7 @@ my @threads = (
$_->setSkipNotification for @threads; # 100+ messages later...
my $versionTag = WebGUI::VersionTag->getWorking( $session );
$versionTag->commit;
addToCleanup($versionTag);
WebGUI::Test->addToCleanup($versionTag);
my $templateVars;
my $posts;

View file

@ -35,7 +35,7 @@ my @threads = (
className => 'WebGUI::Asset::Post::Thread',
status => 'archived',
title => 'Archived',
}, undef, undef, { skipAutoCommitWorkflows => 1 }),
}, undef, undef, { skipAutoCommitWorkflows => 1, skipNotification => 1 }),
);
my $tag = WebGUI::VersionTag->getWorking( $session );