Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit faa17fd2cee9a893c4ec6e03f0f2da920ec42f2c 1 parent 5b3ef29
@sminnee sminnee authored
Showing with 12 additions and 6 deletions.
  1. +6 −5 tests/CMSMainTest.php
  2. +6 −1 tests/CMSMainTest.yml
View
11 tests/CMSMainTest.php
@@ -36,7 +36,7 @@ function testPublish() {
$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 @@ function testPublish() {
$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 @@ function testCreationOfTopLevelPage(){
// TODO Logout
$this->session()->inst_set('loggedInAs', NULL);
}
-}
+}
View
7 tests/CMSMainTest.yml
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.