Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Debug needs an explicit package name for addToCleanup.
  • Loading branch information
perlDreamer committed Oct 19, 2011
1 parent 19b6f9d commit 82bb59d
Show file tree
Hide file tree
Showing 47 changed files with 99 additions and 99 deletions.
2 changes: 1 addition & 1 deletion t/Asset.t
Expand Up @@ -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%'");
Expand Down
40 changes: 20 additions & 20 deletions t/Asset/Asset.t
Expand Up @@ -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({
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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'
Expand All @@ -404,7 +404,7 @@ my $properties2 = {
};

my $fixTitleAsset = $defaultAsset->addChild($properties2, $properties2->{id});
addToCleanup( $fixTitleAsset );
WebGUI::Test->addToCleanup( $fixTitleAsset );

$properties2 = {
# '1234567890123456789012'
Expand All @@ -415,7 +415,7 @@ $properties2 = {
};

my $getTitleAsset = $defaultAsset->addChild($properties2, $properties2->{id});
addToCleanup( $getTitleAsset );
WebGUI::Test->addToCleanup( $getTitleAsset );

$session->setting->set('urlExtension', undef);

Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -666,7 +666,7 @@ $properties = {
};

my $iufpAsset = $defaultAsset->addChild($properties, $properties->{id});
addToCleanup( $iufpAsset );
WebGUI::Test->addToCleanup( $iufpAsset );
$iufpAsset->commit;

$properties2 = {
Expand All @@ -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;
Expand All @@ -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');

Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion t/Asset/AssetExportHtml.t
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions t/Asset/File.t
Expand Up @@ -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,
Expand All @@ -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" );

#----------------------------------------------------------------------------
Expand All @@ -144,7 +144,7 @@ $asset->update({
filename => $filename,
});

addToCleanup( $asset );
WebGUI::Test->addToCleanup( $asset );
$asset->trash;
my $storage = $asset->getStorageLocation;
my $dir = $storage->getPathClassDir();
Expand Down
2 changes: 1 addition & 1 deletion t/Asset/File/GalleryFile/Photo/adjustOrientation.t
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion t/Asset/File/GalleryFile/Photo/edit.t
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion t/Asset/File/Image.t
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions t/Asset/Post/Thread.t
Expand Up @@ -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 } );
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions t/Asset/Snippet.t
Expand Up @@ -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
Expand Down Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion t/Asset/Template.t
Expand Up @@ -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';
Expand Down
8 changes: 4 additions & 4 deletions t/Asset/WikiPage/permissions.t
Expand Up @@ -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]);
Expand All @@ -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({
Expand All @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions t/Asset/Wobject/Calendar.t
Expand Up @@ -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');

Expand Down Expand Up @@ -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 });

Expand Down
6 changes: 3 additions & 3 deletions t/Asset/Wobject/Collaboration.t
Expand Up @@ -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" );

Expand Down Expand Up @@ -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');
Expand All @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion t/Asset/Wobject/Collaboration/templateVariables.t
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion t/Asset/Wobject/Gallery/search.t
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion t/Asset/Wobject/GalleryAlbum/addArchive.t
Expand Up @@ -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({
Expand Down

0 comments on commit 82bb59d

Please sign in to comment.