almost done fixing addRevision tests

This commit is contained in:
Doug Bell 2010-11-19 19:26:39 -06:00
parent 6931fd471e
commit 7c14d1e6c4
122 changed files with 389 additions and 1052 deletions

View file

@ -25,7 +25,7 @@ plan tests => 6; # increment this value for each test you create
my $session = WebGUI::Test->session;
$session->user({userId => 3});
my $home = WebGUI::Asset->getDefault($session);
my $home = WebGUI::Test->asset;
my $wgBday = WebGUI::Test->webguiBirthday;
my $creationDateSth = $session->db->prepare('update asset set creationDate=? where assetId=?');
@ -58,13 +58,6 @@ my $weekStory = $weekFolder->addChild({className => 'WebGUI::Asset::Story',});
$creationDateSth->execute([$weekAgo, $weekFolder->getId]);
$creationDateSth->execute([$weekAgo, $weekStory->getId]);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
WebGUI::Test->addToCleanup($versionTag);
foreach my $asset ($archive1, $archive2) {
$asset = $asset->cloneFromDb;
}
my $workflow = WebGUI::Workflow->create($session,
{
enabled => 1,

View file

@ -18,10 +18,7 @@ use DateTime;
use Data::Dumper;
my $session = WebGUI::Test->session;
my $temp = WebGUI::Asset->getTempspace($session);
my $tag = WebGUI::VersionTag->getWorking($session);
WebGUI::Test::addToCleanup($tag);
my $temp = WebGUI::Test->asset;
my $calendar = $temp->addChild(
{ className => 'WebGUI::Asset::Wobject::Calendar' }

View file

@ -30,7 +30,7 @@ WebGUI::Test->addToCleanup(sub { WebGUI::Test->cleanupAdminInbox; });
WebGUI::Test->addToCleanup(SQL => "delete from mailQueue where message like '%Threshold=15%'");
my $inbox = WebGUI::Inbox->new($session);
my $import = WebGUI::Asset->getImportNode($session);
my $import = WebGUI::Test->asset;
my $posters = $import->addChild({
className => 'WebGUI::Asset::Sku::Product',
@ -38,11 +38,6 @@ my $posters = $import->addChild({
title => "Red's Posters",
}, undef, time()-15, { skipAutoCommitWorkflows => 1, });
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit();
WebGUI::Test->addToCleanup($versionTag);
$posters = $posters->cloneFromDb;
my $ritaVarId = $posters->setCollateral('variantsJSON', 'variantId', 'new',
{
shortdesc => 'Rita Hayworth',

View file

@ -23,15 +23,11 @@ plan tests => 6; # increment this value for each test you create
my $session = WebGUI::Test->session;
$session->user({userId => 3});
my $root = WebGUI::Asset->getRoot($session);
my $root = WebGUI::Test->asset;
my $donation = $root->addChild({
className => 'WebGUI::Asset::Sku::Donation',
title => 'test donation',
});
my $tag = WebGUI::VersionTag->getWorking($session);
$tag->commit;
WebGUI::Test->addToCleanup($tag);
my $cart1 = WebGUI::Shop::Cart->create($session);
WebGUI::Test->addToCleanup($cart1);

View file

@ -39,8 +39,7 @@ $sendmock->fake_module('WebGUI::Mail::Send',
);
##Create Assets;
my $home = WebGUI::Asset->getDefault($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
my $home = WebGUI::Test->asset;
#1234567890123456789012#
my $templateId = 'NEWSLETTER_TEMPLATE___';
@ -65,10 +64,9 @@ my $thread = $cs->addChild({
title => 'Test Thread',
content => 'This is the content',
synopsis => 'This is the synopsis',
}, undef, undef, {skipAutoCommitWorkflows => 1,});
$versionTag->commit;
WebGUI::Test->addToCleanup($versionTag);
},);
$thread->setSkipNotification;
$thread->commit;
##Setup metadata
$session->setting->set('metaDataEnabled', 1);

View file

@ -27,7 +27,7 @@ my $bday = WebGUI::DateTime->new($session, WebGUI::Test->webguiBirthday)->cl
my $now = WebGUI::DateTime->new($session, time())->cloneToUserTimeZone;
my $tz = $session->datetime->getTimeZone();
my $root = WebGUI::Asset->getRoot($session);
my $root = WebGUI::Test->asset;
my $calendar = $root->addChild({
className => 'WebGUI::Asset::Wobject::Calendar',
title => 'Test Calendar',
@ -38,7 +38,7 @@ my $wgBday = $calendar->addChild({
startDate => $bday->toDatabaseDate,
endDate => $bday->toDatabaseDate,
timeZone => $tz,
}, undef, undef, {skipAutoCommitWorkflows => 1});
});
my $wrongBday = $calendar->addChild({
className => 'WebGUI::Asset::Event',
@ -46,12 +46,12 @@ my $wrongBday = $calendar->addChild({
startDate => $bday->toDatabaseDate,
endDate => $bday->toDatabaseDate,
timeZone => $tz,
}, undef, time()-5, {skipAutoCommitWorkflows => 1});
}, undef, time()-5);
$wrongBday->addRevision({
startDate => $now->toDatabaseDate,
endDate => $now->toDatabaseDate,
}, undef, undef, {skipAutoCommitWorkflows => 1});
},);
my $nowEvent = $calendar->addChild({
className => 'WebGUI::Asset::Event',
@ -59,11 +59,7 @@ my $nowEvent = $calendar->addChild({
startDate => $now->toDatabaseDate,
endDate => $now->toDatabaseDate,
timeZone => $tz,
}, undef, undef, {skipAutoCommitWorkflows => 1});
my $tag = WebGUI::VersionTag->getWorking($session);
$tag->commit;
WebGUI::Test->addToCleanup($tag);
}, );
my $workflow = WebGUI::Workflow->create($session,
{