mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merge pull request #295 from silverstripe-rebelalliance/feature/config
FIX CMSMainTest to access batch_action config property properly
This commit is contained in:
commit
9bce266639
@ -9,23 +9,6 @@ class CMSMainTest extends FunctionalTest {
|
|||||||
|
|
||||||
static protected $orig = array();
|
static protected $orig = array();
|
||||||
|
|
||||||
public function setUpOnce() {
|
|
||||||
self::$orig['CMSBatchActionHandler_batch_actions'] = CMSBatchActionHandler::$batch_actions;
|
|
||||||
CMSBatchActionHandler::$batch_actions = array(
|
|
||||||
'publish' => 'CMSBatchAction_Publish',
|
|
||||||
'delete' => 'CMSBatchAction_Delete',
|
|
||||||
'deletefromlive' => 'CMSBatchAction_DeleteFromLive',
|
|
||||||
);
|
|
||||||
|
|
||||||
parent::setUpOnce();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function tearDownOnce() {
|
|
||||||
CMSBatchActionHandler::$batch_actions = self::$orig['CMSBatchActionHandler_batch_actions'];
|
|
||||||
|
|
||||||
parent::tearDownOnce();
|
|
||||||
}
|
|
||||||
|
|
||||||
function testSiteTreeHints() {
|
function testSiteTreeHints() {
|
||||||
$cache = SS_Cache::factory('CMSMain_SiteTreeHints');
|
$cache = SS_Cache::factory('CMSMain_SiteTreeHints');
|
||||||
$cache->clean(Zend_Cache::CLEANING_MODE_ALL);
|
$cache->clean(Zend_Cache::CLEANING_MODE_ALL);
|
||||||
@ -97,7 +80,8 @@ class CMSMainTest extends FunctionalTest {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Some modules (e.g., cmsworkflow) will remove this action
|
// Some modules (e.g., cmsworkflow) will remove this action
|
||||||
if(isset(CMSBatchActionHandler::$batch_actions['publish'])) {
|
$actions = CMSBatchActionHandler::config()->batch_actions;
|
||||||
|
if(isset($actions['publish'])) {
|
||||||
$response = $this->get('admin/pages/batchactions/publish?ajax=1&csvIDs=' . implode(',', array($page1->ID, $page2->ID)));
|
$response = $this->get('admin/pages/batchactions/publish?ajax=1&csvIDs=' . implode(',', array($page1->ID, $page2->ID)));
|
||||||
$responseData = Convert::json2array($response->getBody());
|
$responseData = Convert::json2array($response->getBody());
|
||||||
$this->assertArrayHasKey($page1->ID, $responseData['modified']);
|
$this->assertArrayHasKey($page1->ID, $responseData['modified']);
|
||||||
|
Loading…
Reference in New Issue
Block a user