From 85a30733be7dd6d4cff6041d4199ec8f222472ac Mon Sep 17 00:00:00 2001 From: Mike Cochrane Date: Sat, 16 Sep 2017 14:20:55 +1200 Subject: [PATCH] Tests: Batch Actions Tests assume enforce_strict_hierarchy is enabled --- tests/php/Controllers/CMSBatchActionsTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/php/Controllers/CMSBatchActionsTest.php b/tests/php/Controllers/CMSBatchActionsTest.php index 9a8a8363..8a2ecd19 100644 --- a/tests/php/Controllers/CMSBatchActionsTest.php +++ b/tests/php/Controllers/CMSBatchActionsTest.php @@ -3,12 +3,13 @@ namespace SilverStripe\CMS\Tests\Controllers; use SilverStripe\CMS\BatchActions\CMSBatchAction_Archive; -use SilverStripe\Versioned\Versioned; use SilverStripe\CMS\BatchActions\CMSBatchAction_Publish; -use SilverStripe\CMS\BatchActions\CMSBatchAction_Unpublish; use SilverStripe\CMS\BatchActions\CMSBatchAction_Restore; +use SilverStripe\CMS\BatchActions\CMSBatchAction_Unpublish; use SilverStripe\CMS\Model\SiteTree; +use SilverStripe\Core\Config\Config; use SilverStripe\Dev\SapphireTest; +use SilverStripe\Versioned\Versioned; /** * Tests CMS Specific subclasses of {@see CMSBatchAction} @@ -24,6 +25,9 @@ class CMSBatchActionsTest extends SapphireTest $this->logInWithPermission('ADMIN'); + // Tests assume strict hierarchy is enabled + Config::inst()->update(SiteTree::class, 'enforce_strict_hierarchy', true); + // published page $published = $this->objFromFixture(SiteTree::class, 'published'); $published->publishSingle();