all tests run individually

This commit is contained in:
Doug Bell 2010-11-17 19:31:44 -06:00
parent 1866c593ea
commit 6931fd471e
25 changed files with 157 additions and 159 deletions

View file

@ -159,22 +159,24 @@ $tag2->rollback;
($tag, $tagAgain1, $tag2, $tagAgain2) = ();
my $tag3 = WebGUI::VersionTag->create($session, {});
my %tag = ( tagId => $tag3->getId, status => "pending" );
$tag3->setWorking;
my $asset1 = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet' });
my $asset2 = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet' });
my $asset1 = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet', %tag });
my $asset2 = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet', %tag });
is($tag3->getAssetCount, 2, 'tag with two assets');
is($tag3->getRevisionCount, 2, 'tag with two revisions');
$asset1 = $asset1->addRevision({ title => 'revised once' }, time+10);
$asset1 = $asset1->addRevision({ title => 'revised twice' }, time+20);
$asset2 = $asset2->addRevision({ title => 'other revised once' }, time+30);
$asset1 = $asset1->addRevision({ title => 'revised once', %tag }, time+10);
$asset1 = $asset1->addRevision({ title => 'revised twice', %tag }, time+20);
$asset2 = $asset2->addRevision({ title => 'other revised once', %tag }, time+30);
is($tag3->getRevisionCount, 5, 'tag with five revisions');
my $tag4 = WebGUI::VersionTag->create($session, {});
$tag{tagId} = $tag4->getId;
$tag4->setWorking;
my $asset3 = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet' });
my $asset3 = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet', %tag });
is($tag4->getAssetCount, 1, 'other tag with one asset');
is($tag4->getRevisionCount, 1, 'other tag with one revision');
$asset3->addRevision({ title => 'again revised once' }, time+40);
$asset3->addRevision({ title => 'again revised once', %tag }, time+40);
is($tag4->getRevisionCount, 2, 'other tag still with one asset');
is($tag4->getRevisionCount, 2, 'other tag with two revisions');
is($tag3->getAssetCount, 2, 'original tag still with two assets');
@ -185,8 +187,9 @@ $tag4->rollback;
#Test commitAsUser
my $tag5 = WebGUI::VersionTag->create($session, {});
$tag{tagId} = $tag5->getId;
$tag5->setWorking;
my $asset5 = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet' });
my $asset5 = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet', %tag });
is($tag5->get("createdBy"),1,'tag created by visitor');
$tag5->commitAsUser(3);
$tag5 = WebGUI::VersionTag->new($session, $tag5->getId); #Get the tag again - properties have changed
@ -196,8 +199,9 @@ $tag5->rollback;
#Test commitAsUser with options
my $tag6 = WebGUI::VersionTag->create($session, {});
$tag{tagId} = $tag6->getId;
$tag6->setWorking;
my $asset6 = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet' });
my $asset6 = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet', %tag });
$tag6->commitAsUser(3, { commitNow => "yes" });
$tag6 = WebGUI::VersionTag->new($session, $tag6->getId); #Get the tag again - properties have changed
is($tag6->get("committedBy"),3,'tag committed by admin again');
@ -321,8 +325,9 @@ $siteWideTag->rollback();
setUserVersionTagMode($user, q{singlePerUser});
my $tag = WebGUI::VersionTag->create($session, {});
$tag{ tagId } = $tag->getId;
$tag->setWorking;
my $asset = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet' });
my $asset = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet', %tag });
is($tag->getAssetCount, 1, qq{$test_prefix [singlePerUser] tag with 1 asset});
# create admin session
@ -372,8 +377,9 @@ $siteWideTag->rollback();
setUserVersionTagMode($user, q{siteWide});
$tag = WebGUI::VersionTag->create($session, {});
$tag{tagId} = $tag->getId;
$tag->setWorking;
$asset = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet' });
$asset = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet', %tag });
is($tag->getAssetCount, 1, qq{$test_prefix [siteWide] tag with 1 asset});
# create admin session