diff --git a/tests/CMSMainTest.php b/tests/CMSMainTest.php index d13d51a2..1bb415d2 100644 --- a/tests/CMSMainTest.php +++ b/tests/CMSMainTest.php @@ -40,11 +40,14 @@ class CMSMainTest extends FunctionalTest { $response->getBody() ); - $response = Director::test("admin/cms/batchactions/publish", array('csvIDs' => '1,2', 'ajax' => 1), $this->session()); - - $responseData = Convert::json2array($response->getBody()); - $this->assertTrue(property_exists($responseData['modified'], '1')); - $this->assertTrue(property_exists($responseData['modified'], '2')); + // 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()); + + $responseData = Convert::json2array($response->getBody()); + $this->assertTrue(property_exists($responseData['modified'], '1')); + $this->assertTrue(property_exists($responseData['modified'], '2')); + } $this->session()->clear('loggedInAs'); @@ -124,8 +127,8 @@ class CMSMainTest extends FunctionalTest { $this->assertType('SiteTree', $livePage); $this->assertTrue($livePage->canDelete()); - // Check that the 'delete from live' button exists as a simple way of checking that the correct page is returned. - $this->assertRegExp('/]+type="submit"[^>]+name="action_deletefromlive"/i', $response->getBody()); + // Check that the 'restore' button exists as a simple way of checking that the correct page is returned. + $this->assertRegExp('/]+type="submit"[^>]+name="action_restore"/i', $response->getBody()); } /**