Permalink
Browse files

MINOR Made CMSMainTest more resilient against database ID changes (Po…

…stgres doesn't have auto-increment resets across tests at the moment) (from r106248)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@112578 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 6f41e77 commit 66f2fad70a2744915fc82c72775bbbb2cce341ec @chillu chillu committed Oct 15, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 tests/CMSMainTest.php
View
@@ -31,6 +31,8 @@ static function tear_down_once() {
* @todo Test the results of a publication better
*/
function testPublish() {
+ $page1 = $this->objFromFixture('Page', "page1");
+ $page2 = $this->objFromFixture('Page', "page2");
$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));
$response = Director::test("admin/cms/publishall", array('confirm' => 1), $this->session());
@@ -42,7 +44,7 @@ function testPublish() {
// Some modules (e.g., cmsworkflow) will remove this action
if(isset(CMSBatchActionHandler::$batch_actions['publish'])) {
- $response = Director::test("admin/cms/batchactions/publish", array('csvIDs' => '1,2', 'ajax' => 1), $this->session());
+ $response = Director::test("admin/cms/batchactions/publish", array('csvIDs' => implode(',', array($page1->ID, $page2->ID)), 'ajax' => 1), $this->session());
$responseData = Convert::json2array($response->getBody());
$this->assertTrue(property_exists($responseData['modified'], '1'));

0 comments on commit 66f2fad

Please sign in to comment.