MINOR: Fixed test that required a separate Page table.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@106090 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-06-02 23:01:41 +00:00
parent 5b3ef295d9
commit faa17fd2ce
2 changed files with 12 additions and 6 deletions

View File

@ -36,7 +36,7 @@ class CMSMainTest extends FunctionalTest {
$response = Director::test("admin/cms/publishall", array('confirm' => 1), $this->session());
$this->assertContains(
sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), 7),
sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), 8),
$response->getBody()
);
@ -48,9 +48,10 @@ class CMSMainTest extends FunctionalTest {
$this->assertContains('setNodeTitle(2, \'Page 2\');', $response->getBody());
}
// Get the latest version of Page 1
$latestID = DB::query('select max("Version") from "Page_versions" where "RecordID"=1')->value();
$dsCount = DB::query('select count("Version") from "Page_versions" where "RecordID"=1 and "Version"=' . $latestID)->value();
// Get the latest version of the redirector page
$pageID = $this->idFromFixture('RedirectorPage', 'page5');
$latestID = DB::query('select max("Version") from "RedirectorPage_versions" where "RecordID"=' . $pageID)->value();
$dsCount = DB::query('select count("Version") from "RedirectorPage_versions" where "RecordID"=' . $pageID . ' and "Version"=' . $latestID)->value();
$this->assertEquals(1, $dsCount, "Published page has no duplicate version records: it has " . $dsCount . " for version " . $latestID);
$this->session()->clear('loggedInAs');
@ -206,4 +207,4 @@ class CMSMainTest extends FunctionalTest {
// TODO Logout
$this->session()->inst_set('loggedInAs', NULL);
}
}
}

View File

@ -77,4 +77,9 @@ PageComment:
Name: Me
Comment: I like this comment
NeedsModeration: 1
EmailAddress: me@test.co.nz
EmailAddress: me@test.co.nz
RedirectorPage:
page5:
Title: Page 5
RedirectionType: External
ExternalURL: http://www.google.com