convert all test cleanup to addToCleanup
This commit is contained in:
parent
421b9652cf
commit
4c18ba3563
82 changed files with 190 additions and 307 deletions
|
|
@ -65,7 +65,7 @@ my $party = $sender->addChild({
|
|||
|
||||
my $tag = WebGUI::VersionTag->getWorking($session);
|
||||
$tag->commit;
|
||||
WebGUI::Test->tagsToRollback($tag);
|
||||
WebGUI::Test->addToCleanup($tag);
|
||||
|
||||
my $workflow = WebGUI::Workflow->create($session,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,19 +26,19 @@ my $wf = WebGUI::Workflow->create($session, {
|
|||
mode => 'realtime',
|
||||
});
|
||||
isa_ok($wf, 'WebGUI::Workflow', 'Test workflow');
|
||||
WebGUI::Test->workflowsToDelete($wf);
|
||||
WebGUI::Test->addToCleanup($wf);
|
||||
|
||||
my $activity = $wf->addActivity('WebGUI::Workflow::Activity::ExpireIncompleteSurveyResponses');
|
||||
isa_ok($activity, 'WebGUI::Workflow::Activity::ExpireIncompleteSurveyResponses', 'Test wf activity');
|
||||
$activity->set('title', 'Test Expire Incomplete Survey Responses');
|
||||
|
||||
my $user = WebGUI::User->new($session, 'new');
|
||||
WebGUI::Test->usersToDelete($user);
|
||||
WebGUI::Test->addToCleanup($user);
|
||||
|
||||
# Create a Survey
|
||||
my $survey = WebGUI::Asset->getImportNode($session)->addChild( { className => 'WebGUI::Asset::Wobject::Survey', } );
|
||||
WebGUI::Test->tagsToRollback(WebGUI::VersionTag->getWorking($session));
|
||||
WebGUI::Test->assetsToPurge($survey);
|
||||
WebGUI::Test->addToCleanup(WebGUI::VersionTag->getWorking($session));
|
||||
WebGUI::Test->addToCleanup($survey);
|
||||
my $sJSON = $survey->surveyJSON;
|
||||
$sJSON->newObject([0]); # add a question to 0th section
|
||||
$sJSON->update([0,0], { questionType => 'Yes/No' });
|
||||
|
|
@ -118,7 +118,7 @@ is( scalar $session->db->buildArray($SQL), 0, 'Afterwards, back to no incomplete
|
|||
|
||||
# Create a new revision
|
||||
$survey->addRevision({}, time+1);
|
||||
WebGUI::Test->tagsToRollback(WebGUI::VersionTag->getWorking($session));
|
||||
WebGUI::Test->addToCleanup(WebGUI::VersionTag->getWorking($session));
|
||||
|
||||
# Undo out handiwork again
|
||||
is($session->db->quickScalar('select count(*) from Survey_response where Survey_responseId = ?', [$responseId]), 1, 'Start off with 1 response');
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ my $donation = $root->addChild({
|
|||
});
|
||||
my $tag = WebGUI::VersionTag->getWorking($session);
|
||||
$tag->commit;
|
||||
WebGUI::Test->tagsToRollback($tag);
|
||||
WebGUI::Test->addToCleanup($tag);
|
||||
|
||||
|
||||
my $cart1 = WebGUI::Shop::Cart->create($session);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ my $thread = $cs->addChild({
|
|||
}, undef, undef, {skipAutoCommitWorkflows => 1,});
|
||||
|
||||
$versionTag->commit;
|
||||
WebGUI::Test->tagsToRollback($versionTag);
|
||||
WebGUI::Test->addToCleanup($versionTag);
|
||||
|
||||
##Setup metadata
|
||||
$session->setting->set('metaDataEnabled', 1);
|
||||
|
|
@ -84,7 +84,7 @@ $thread->updateMetaData($metaDataFields->{newsletterCategory}, 'Andy');
|
|||
##Create subscriber user
|
||||
my $subscriber = WebGUI::User->create($session);
|
||||
$subscriber->update({ 'email', 'going@nowhere.com' });
|
||||
WebGUI::Test->usersToDelete($subscriber);
|
||||
WebGUI::Test->addToCleanup($subscriber);
|
||||
$cs->setUserSubscriptions($metaDataFields->{newsletterCategory}."~Andy", $subscriber->getId);
|
||||
$session->db->write(<<EOSQL, [ time()-24*60*60, $cs->getId, $subscriber->getId ]);
|
||||
update Newsletter_subscriptions set lastTimeSent=? where assetId=? and userId=?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue