Debug needs an explicit package name for addToCleanup.

This commit is contained in:
Colin Kuskie 2011-10-19 13:11:23 -07:00
parent 19b6f9de12
commit 82bb59d40e
47 changed files with 99 additions and 99 deletions

View file

@ -59,14 +59,14 @@ $testGroups{'canEdit asset'} = WebGUI::Group->new($session, 'new');
$testUsers{'canEdit group user'} = WebGUI::User->new($session, 'new');
$testUsers{'canEdit group user'}->addToGroups([$testGroups{'canEdit asset'}->getId]);
$testUsers{'canEdit group user'}->username('Edit Group User');
addToCleanup($testGroups{'canEdit asset'});
WebGUI::Test->addToCleanup($testGroups{'canEdit asset'});
##A group and user for groupIdEdit
$testGroups{'canAdd asset'} = WebGUI::Group->new($session, 'new');
$testUsers{'canAdd group user'} = WebGUI::User->new($session, 'new');
$testUsers{'canAdd group user'}->addToGroups([$testGroups{'canAdd asset'}->getId]);
$testUsers{'canEdit group user'}->username('Can Add Group User');
addToCleanup($testGroups{'canAdd asset'}, values %testUsers);
WebGUI::Test->addToCleanup($testGroups{'canAdd asset'}, values %testUsers);
my $canAddMaker = WebGUI::Test::Maker::Permission->new();
$canAddMaker->prepare({
@ -99,7 +99,7 @@ $properties = {
};
my $canEditAsset = $rootAsset->addChild($properties, $properties->{id});
addToCleanup( $canEditAsset );
WebGUI::Test->addToCleanup( $canEditAsset );
$properties = {}; ##Clear out the hash so that it doesn't leak later by accident.
my $canEditMaker = WebGUI::Test::Maker::Permission->new();
@ -123,7 +123,7 @@ $properties = {
my $canViewAsset = $rootAsset->addChild($properties, $properties->{id});
addToCleanup( $canViewAsset );
WebGUI::Test->addToCleanup( $canViewAsset );
$properties = {}; ##Clear out the hash so that it doesn't leak later by accident.
my $canViewMaker = WebGUI::Test::Maker::Permission->new();
@ -363,21 +363,21 @@ my $properties = {
};
my $fixUrlAsset = $defaultAsset->addChild($properties, $properties->{id});
addToCleanup( $fixUrlAsset );
WebGUI::Test->addToCleanup( $fixUrlAsset );
# '1234567890123456789012'
$properties->{id} = 'fixUrlAsset00000000013';
$properties->{url} = 'fixUrlFolderURL9';
my $fixUrlAsset2 = $defaultAsset->addChild($properties, $properties->{id});
addToCleanup( $fixUrlAsset2 );
WebGUI::Test->addToCleanup( $fixUrlAsset2 );
# '1234567890123456789012'
$properties->{id} = 'fixUrlAsset00000000014';
$properties->{url} = 'fixUrlFolderURL00';
my $fixUrlAsset3 = $defaultAsset->addChild($properties, $properties->{id});
addToCleanup( $fixUrlAsset3 );
WebGUI::Test->addToCleanup( $fixUrlAsset3 );
# '1234567890123456789012'
$properties->{id} = 'fixUrlAsset00000000015';
@ -385,7 +385,7 @@ $properties->{url} = 'fixUrlFolderURL100';
my $fixUrlAsset4 = $defaultAsset->addChild($properties, $properties->{id});
is($fixUrlAsset4->get('url'), 'fixurlfolderurl100', 'asset setup correctly for 100->101 test');
addToCleanup( $fixUrlAsset4 );
WebGUI::Test->addToCleanup( $fixUrlAsset4 );
delete $properties->{url};
# '1234567890123456789012'
@ -393,7 +393,7 @@ $properties->{id} = 'fixUrlAsset00000000016';
$properties->{menuTitle} = 'fix url folder url autogenerated';
my $fixUrlAsset5 = $defaultAsset->addChild($properties, $properties->{id});
addToCleanup( $fixUrlAsset5 );
WebGUI::Test->addToCleanup( $fixUrlAsset5 );
my $properties2 = {
# '1234567890123456789012'
@ -404,7 +404,7 @@ my $properties2 = {
};
my $fixTitleAsset = $defaultAsset->addChild($properties2, $properties2->{id});
addToCleanup( $fixTitleAsset );
WebGUI::Test->addToCleanup( $fixTitleAsset );
$properties2 = {
# '1234567890123456789012'
@ -415,7 +415,7 @@ $properties2 = {
};
my $getTitleAsset = $defaultAsset->addChild($properties2, $properties2->{id});
addToCleanup( $getTitleAsset );
WebGUI::Test->addToCleanup( $getTitleAsset );
$session->setting->set('urlExtension', undef);
@ -613,9 +613,9 @@ my $node = WebGUI::Asset->getRoot($session);
my $product1 = $node->addChild({ className => 'WebGUI::Asset::Sku::Product'}, undef, undef, { skipAutoCommitWorkflows => 1});
my $product2 = $node->addChild({ className => 'WebGUI::Asset::Sku::Product'}, undef, undef, { skipAutoCommitWorkflows => 1});
my $product3 = $node->addChild({ className => 'WebGUI::Asset::Sku::Product'}, undef, undef, { skipAutoCommitWorkflows => 1});
addToCleanup($product1, $product2, $product3);
WebGUI::Test->addToCleanup($product1, $product2, $product3);
my $product4 = $node->addChild({ className => 'WebGUI::Asset::Sku::Product', status => "pending"}, undef, undef, { skipAutoCommitWorkflows => 1});
addToCleanup($product4);
WebGUI::Test->addToCleanup($product4);
my $getAProduct = WebGUI::Asset::Sku::Product->getIsa($session);
isa_ok($getAProduct, 'CODE');
@ -666,7 +666,7 @@ $properties = {
};
my $iufpAsset = $defaultAsset->addChild($properties, $properties->{id});
addToCleanup( $iufpAsset );
WebGUI::Test->addToCleanup( $iufpAsset );
$iufpAsset->commit;
$properties2 = {
@ -678,7 +678,7 @@ $properties2 = {
};
my $iufpAsset2 = $iufpAsset->addChild($properties2, $properties2->{id});
addToCleanup( $iufpAsset2 );
WebGUI::Test->addToCleanup( $iufpAsset2 );
$iufpAsset2->update( { inheritUrlFromParent => 1 } );
is $iufpAsset2->inheritUrlFromParent, 1, 'inheritUrlFromParent set';
$iufpAsset2->commit;
@ -694,7 +694,7 @@ my $properties2a = {
};
my $iufpAsset2a = $iufpAsset->addChild($properties2a, $properties2a->{id});
addToCleanup( $iufpAsset2a );
WebGUI::Test->addToCleanup( $iufpAsset2a );
$iufpAsset2a->commit;
is($iufpAsset2a->url, 'inheriturlfromparent01/inheriturlfromparent2a', '... works when created with the property');
@ -716,7 +716,7 @@ my $properties3 = {
url => 'inheriturlfromparent03',
};
my $iufpAsset3 = $iufpAsset2->addChild($properties3, $properties3->{id});
addToCleanup( $iufpAsset3 );
WebGUI::Test->addToCleanup( $iufpAsset3 );
$iufpAsset3->commit;
$iufpAsset2->update( { inheritUrlFromParent => 1 } );
$iufpAsset2->commit;
@ -741,7 +741,7 @@ my $assetToCommit = $defaultAsset->addChild({
status => "pending",
tagId => $cloneTag->getId,
});
addToCleanup($cloneTag);
WebGUI::Test->addToCleanup($cloneTag);
$cloneTag->commit;
is($assetToCommit->get('status'), 'pending', 'cloneFromDb: local asset is still pending');
$assetToCommit = $assetToCommit->cloneFromDb;
@ -760,7 +760,7 @@ my $trashedAsset = $defaultAsset->addChild({
my $clippedAsset = $defaultAsset->addChild({
className => 'WebGUI::Asset::Snippet', title => 'Clippy',
});
addToCleanup( $trashedAsset, $clippedAsset );
WebGUI::Test->addToCleanup( $trashedAsset, $clippedAsset );
$trashedAsset = $trashedAsset->cloneFromDb;
$clippedAsset = $clippedAsset->cloneFromDb;
$trashedAsset->trash;
@ -800,7 +800,7 @@ use HTML::Packer;
my $asset = WebGUI::Asset->getImportNode( $session )->addChild({
className => 'WebGUI::Asset::Snippet',
});
addToCleanup( $asset );
WebGUI::Test->addToCleanup( $asset );
my $unpacked = qq{<title>

View file

@ -183,7 +183,7 @@ is(-d $accessibleDirectory, 1, "exportCheckPath creating subdirectory actually c
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Asset Export Test"});
addToCleanup($versionTag);
WebGUI::Test->addToCleanup($versionTag);
my $importNode = WebGUI::Asset->getImportNode($session);

View file

@ -109,7 +109,7 @@ cmp_deeply(
#----------------------------------------------------------------------------
# Add another new revision, changing the privs
my $newRev = $asset->addRevision( { ownerUserId => '3', groupIdView => '3' }, time + 5 );
addToCleanup( $newRev );
WebGUI::Test->addToCleanup( $newRev );
$privs = JSON->new->decode( $newRev->getStorageLocation->getFileContentsAsScalar('.wgaccess') );
cmp_deeply(
$privs,
@ -123,7 +123,7 @@ cmp_deeply(
# Add a new revision, changing the privs
my $newRev = $asset->addRevision( { groupIdView => '7' }, time + 8 );
addToCleanup( $newRev );
WebGUI::Test->addToCleanup( $newRev );
is( $newRev->getStorageLocation->getFileContentsAsScalar('.wgaccess'), undef, "wgaccess doesn't exist" );
#----------------------------------------------------------------------------
@ -144,7 +144,7 @@ $asset->update({
filename => $filename,
});
addToCleanup( $asset );
WebGUI::Test->addToCleanup( $asset );
$asset->trash;
my $storage = $asset->getStorageLocation;
my $dir = $storage->getPathClassDir();

View file

@ -32,7 +32,7 @@ my $versionTag = WebGUI::VersionTag->getWorking($session);
# Name version tag and make sure it gets cleaned up
$versionTag->set({name=>"Orientation adjustment test"});
my %tag = ( tagId => $versionTag->getId, status => "pending" );
addToCleanup($versionTag);
WebGUI::Test->addToCleanup($versionTag);
# Create gallery and a single album
my $gallery

View file

@ -34,7 +34,7 @@ my $node = WebGUI::Asset->getImportNode( $session );
# Create version tag and make sure it gets cleaned up
my $versionTag = WebGUI::VersionTag->getWorking($session);
addToCleanup($versionTag);
WebGUI::Test->addToCleanup($versionTag);
# Override some settings to make things easier to test
# userFunctionStyleId

View file

@ -40,7 +40,7 @@ $rectangle->setBackgroundColor('#0000FF');
##Create a storage location
my $storage = WebGUI::Storage->create($session);
addToCleanup($storage);
WebGUI::Test->addToCleanup($storage);
##Save the image to the location
$rectangle->saveToStorageLocation($storage, 'blue.png');

View file

@ -25,7 +25,7 @@ my $node = WebGUI::Asset->getImportNode($session);
# Grab a named version tag
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Collab setup"});
addToCleanup($versionTag);
WebGUI::Test->addToCleanup($versionTag);
# Need to create a Collaboration system in which the post lives.
my @addArgs = ( undef, undef, { skipNotification => 1 } );
@ -78,7 +78,7 @@ note 'getCSLinkUrl';
my @newThreads;
my $threadCount = 15;
my $versionTag2 = WebGUI::VersionTag->getWorking($session);
addToCleanup( $versionTag2 );
WebGUI::Test->addToCleanup( $versionTag2 );
$props->{tagId} = $versionTag2->getId;
while ($threadCount--) {
push @newThreads, $collab->addChild($props, @addArgs);

View file

@ -23,7 +23,7 @@ my $node = WebGUI::Asset->getImportNode($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Snippet Test"});
my %tag = ( tagId => $versionTag->getId, status => "pending" );
addToCleanup($versionTag);
WebGUI::Test->addToCleanup($versionTag);
my $snippet = $node->addChild({className=>'WebGUI::Asset::Snippet', %tag});
# Make sure TemplateToolkit is in the config file
@ -103,7 +103,7 @@ $tag{tagId} = $tag2->getId;
my $snippet2 = $node->addChild({className => 'WebGUI::Asset::Snippet', %tag});
$snippet2->update({mimeType => 'text/javascript'});
$tag2->commit;
addToCleanup($tag2);
WebGUI::Test->addToCleanup($tag2);
$snippet2->snippet('uncompressable');
is $snippet2->snippetPacked, 'uncompressable', 'packed snippet content was set';

View file

@ -23,7 +23,7 @@ use JSON qw{ from_json };
my $session = WebGUI::Test->session;
my $tag = WebGUI::VersionTag->getWorking($session);
addToCleanup( $tag );
WebGUI::Test->addToCleanup( $tag );
my %tag = ( tagId => $tag->getId, status => "pending" );
my $default = $session->config->get('defaultTemplateParser');
my $ht = 'WebGUI::Asset::Template::HTMLTemplate';

View file

@ -24,12 +24,12 @@ my $node = WebGUI::Asset->getImportNode($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Wiki Test"});
my %tag = ( tagId => $versionTag->getId, status => "pending" );
addToCleanup($versionTag);
WebGUI::Test->addToCleanup($versionTag);
my $assetEdit = WebGUI::Group->new($session, "new");
my $wikiAdmin = WebGUI::Group->new($session, "new");
my $wikiEditPage = WebGUI::Group->new($session, "new");
addToCleanup($assetEdit, $wikiAdmin, $wikiEditPage);
WebGUI::Test->addToCleanup($assetEdit, $wikiAdmin, $wikiEditPage);
my $assetEditor = WebGUI::User->create($session);
$assetEdit->addUsers([$assetEditor->userId]);
@ -39,7 +39,7 @@ my $wikiPageEditor = WebGUI::User->create($session);
$wikiEditPage->addUsers([$wikiPageEditor->userId]);
my $wikiOwner = WebGUI::User->create($session);
my $wikiPageOwner = WebGUI::User->create($session);
addToCleanup($assetEditor, $wikiAdministrator, $wikiPageEditor, $wikiOwner, $wikiPageOwner);
WebGUI::Test->addToCleanup($assetEditor, $wikiAdministrator, $wikiPageEditor, $wikiOwner, $wikiPageOwner);
$session->user({user => $wikiOwner});
my $wiki = $node->addChild({
@ -57,7 +57,7 @@ my $wikipage = $wiki->addChild({
}, undef, undef, {skipAutoCommitWorkflows => 1, skipNotification => 1});
is $wikipage->get('ownerUserId'), $wikiPageOwner->userId, 'wiki page owned by correct user';
addToCleanup($wikipage);
WebGUI::Test->addToCleanup($wikipage);
# Test for sane object types
isa_ok($wiki, 'WebGUI::Asset::Wobject::WikiMaster');

View file

@ -310,7 +310,7 @@ my $coincidentHigh = $windowCal->addChild({
# Everything above the window should be included in the set of events returned.
$tag2->commit;
addToCleanup($tag2);
WebGUI::Test->addToCleanup($tag2);
is(scalar @{ $windowCal->getLineage(['children'])}, 17, 'added events to the window calendar');
@ -556,7 +556,7 @@ my $prevDay = $listCal->addChild({
my $tag6 = WebGUI::VersionTag->getWorking($session);
$tag6->commit;
addToCleanup($tag6);
WebGUI::Test->addToCleanup($tag6);
my $listVars = $listCal->viewList({ start => $bday });

View file

@ -32,7 +32,7 @@ my $node = WebGUI::Test->asset;
# grab a named version tag
my $versionTag = WebGUI::VersionTag->getWorking($session);
addToCleanup($versionTag);
WebGUI::Test->addToCleanup($versionTag);
$versionTag->set({name => 'Collaboration => groupToEditPost test'});
my %tag = ( tagId => $versionTag->getId, status => "pending" );
@ -74,7 +74,7 @@ my $props = {
my $thread = $collab->addChild($props, @addChildCoda);
$thread->setSkipNotification;
$tag1->commit;
addToCleanup($tag1);
WebGUI::Test->addToCleanup($tag1);
# Test for a sane object type
isa_ok($thread, 'WebGUI::Asset::Post::Thread');
@ -89,7 +89,7 @@ $props = {
my $thread2 = $collab->addChild($props, @addChildCoda);
$thread2->setSkipNotification;
$tag2->commit;
addToCleanup($tag2);
WebGUI::Test->addToCleanup($tag2);
my $rssitems = $collab->getRssFeedItems();
is(scalar @{ $rssitems }, 2, 'rssitems set to number of posts added');

View file

@ -110,7 +110,7 @@ foreach my $index (1 .. 5) {
$newThreads[$index]->setSkipNotification;
}
$vt2->commit;
addToCleanup($vt2);
WebGUI::Test->addToCleanup($vt2);
$session->user({userId => 3});
$templateVars = $collab->getViewTemplateVars();

View file

@ -33,7 +33,7 @@ my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set( { name=>"Gallery Search Test" } );
my %tag = ( tagId => $versionTag->getId, status => "pending" );
addToCleanup( $versionTag );
WebGUI::Test->addToCleanup( $versionTag );
# Create gallery and a single album
my $gallery

View file

@ -25,7 +25,7 @@ my $node = WebGUI::Asset->getImportNode($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
my %tag = ( tagId => $versionTag->getId, status => "pending" );
$versionTag->set({name=>"Add Archive to Album Test"});
addToCleanup($versionTag);
WebGUI::Test->addToCleanup($versionTag);
my $gallery
= $node->addChild({

View file

@ -134,7 +134,7 @@ is($todayFolder->get('styleTemplateId'), $archive->get('styleTemplateId'), '...
className => 'WebGUI::Asset::Wobject::StoryArchive',
title => 'Extension Tester',
});
addToCleanup($arch2);
WebGUI::Test->addToCleanup($arch2);
is $arch2->get('url'),
$home->get('url').'/extension-tester.ext',