From 022e3ee2eef4bbafb90171237d48db83e69fe1bd Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 21 Oct 2009 19:57:47 +0000 Subject: [PATCH] BUGFIX Added setup/teardown methods to CMSMainTest to fix test breakages when used alongside cmsworkflow module (which unsets the public batch action) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@89864 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tests/CMSMainTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/CMSMainTest.php b/tests/CMSMainTest.php index 919ba7bb..446fda50 100644 --- a/tests/CMSMainTest.php +++ b/tests/CMSMainTest.php @@ -8,6 +8,26 @@ class CMSMainTest extends FunctionalTest { protected $autoFollowRedirection = false; + static protected $orig = array(); + + static function set_up_once() { + self::$orig['CMSBatchActionHandler_batch_actions'] = CMSBatchActionHandler::$batch_actions; + CMSBatchActionHandler::$batch_actions = array( + 'publish' => 'CMSBatchAction_Publish', + 'unpublish' => 'CMSBatchAction_Unpublish', + 'delete' => 'CMSBatchAction_Delete', + 'deletefromlive' => 'CMSBatchAction_DeleteFromLive', + ); + + parent::set_up_once(); + } + + static function tear_down_once() { + CMSBatchActionHandler::$batch_actions = self::$orig['CMSBatchActionHandler_batch_actions']; + + parent::tear_down_once(); + } + /** * @todo Test the results of a publication better */