Skip to content
Permalink
Browse files

Debug needs an explicit package name for addToCleanup.

  • Loading branch information...
perlDreamer committed Oct 19, 2011
1 parent 19b6f9d commit 82bb59d40e55706e68eee7550a19356fa7a954c5
Showing with 99 additions and 99 deletions.
  1. +1 −1 t/Asset.t
  2. +20 −20 t/Asset/Asset.t
  3. +1 −1 t/Asset/AssetExportHtml.t
  4. +3 −3 t/Asset/File.t
  5. +1 −1 t/Asset/File/GalleryFile/Photo/adjustOrientation.t
  6. +1 −1 t/Asset/File/GalleryFile/Photo/edit.t
  7. +1 −1 t/Asset/File/Image.t
  8. +2 −2 t/Asset/Post/Thread.t
  9. +2 −2 t/Asset/Snippet.t
  10. +1 −1 t/Asset/Template.t
  11. +4 −4 t/Asset/WikiPage/permissions.t
  12. +2 −2 t/Asset/Wobject/Calendar.t
  13. +3 −3 t/Asset/Wobject/Collaboration.t
  14. +1 −1 t/Asset/Wobject/Collaboration/templateVariables.t
  15. +1 −1 t/Asset/Wobject/Gallery/search.t
  16. +1 −1 t/Asset/Wobject/GalleryAlbum/addArchive.t
  17. +1 −1 t/Asset/Wobject/StoryArchive.t
  18. +2 −2 t/AssetHelper/Copy.t
  19. +2 −2 t/AssetHelper/CopyBranch.t
  20. +1 −1 t/AssetHelper/Lock.t
  21. +1 −1 t/AssetHelper/Product/ExportCSV.t
  22. +2 −2 t/Auth/LDAP.t
  23. +1 −1 t/Auth/WebGUI.t
  24. +1 −1 t/DatabaseLink.t
  25. +1 −1 t/DateTime.t
  26. +1 −1 t/Group.t
  27. +3 −3 t/LDAPLink.t
  28. +1 −1 t/Macro/CanEditText.t
  29. +2 −2 t/Macro/GroupAdd.t
  30. +2 −2 t/Macro/GroupDelete.t
  31. +3 −3 t/Macro/GroupText.t
  32. +1 −1 t/Macro/MiniCart.t
  33. +1 −1 t/Macro/NewMail.t
  34. +1 −1 t/Macro/RootTitle.t
  35. +1 −1 t/Macro/SQL.t
  36. +2 −2 t/Macro/UsersOnline.t
  37. +1 −1 t/SQL.t
  38. +2 −2 t/Shop/ShipDriver/UPS.t
  39. +3 −3 t/Shop/ShipDriver/USPS.t
  40. +3 −3 t/Shop/ShipDriver/USPSInternational.t
  41. +3 −3 t/Shop/Transaction.t
  42. +1 −1 t/Template/downgrade.t
  43. +1 −1 t/Upgrade.t
  44. +4 −4 t/VersionTag.t
  45. +2 −2 t/Workflow/Activity/NotifyAboutLowStock.t
  46. +2 −2 t/Workflow/Activity/RecheckVATNumber.t
  47. +2 −2 t/Workflow/Instance.t
@@ -306,7 +306,7 @@ my $session = WebGUI::Test->session;
is $revAsset->revisedBy, $session->user->userId, 'revisedBy is current session user';
my $count = $session->db->quickScalar('SELECT COUNT(*) from assetData where assetId=?',[$testId2]);
is $count, 2, 'two records in the database';
addToCleanup($tag);
WebGUI::Test->addToCleanup($tag);

$session->db->write("delete from asset where assetId like 'wg8TestAsset00000%'");
$session->db->write("delete from assetData where assetId like 'wg8TestAsset00000%'");
@@ -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,37 +363,37 @@ 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';
$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'
$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>
@@ -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);

@@ -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();
@@ -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
@@ -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
@@ -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');
@@ -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);
@@ -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';
@@ -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';
@@ -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');
@@ -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 });

@@ -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');
@@ -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();
@@ -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
@@ -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({
Oops, something went wrong.

0 comments on commit 82bb59d

Please sign in to comment.
You can’t perform that action at this time.