From 340230b9c93ecedc53d2f8bc0fc766d68511bc60 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 16 Feb 2010 04:03:02 +0000 Subject: [PATCH] MINOR more unit tests around loose hierarchy (from r98509) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@99121 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tests/CMSMainTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/CMSMainTest.php b/tests/CMSMainTest.php index 266b6592..3eebd655 100644 --- a/tests/CMSMainTest.php +++ b/tests/CMSMainTest.php @@ -106,6 +106,24 @@ class CMSMainTest extends FunctionalTest { $this->assertTrue($page->getCMSFields(null) instanceof FieldSet); } + } + + function testCanPublishPageWithUnpublishedParentWithStrictHierarchyOff() { + $this->logInWithPermssion('ADMIN'); + + SiteTree::enforce_strict_hierarchy(true); + $parentPage = $this->objFromFixture('Page','page3'); + $childPage = $this->objFromFixture('Page','page1'); + + $parentPage->doUnpublish(); + $childPage->doUnpublish(); + + $this->assertContains( + 'action_publish', + $childPage->getCMSActions()->column('Name'), + 'Can publish a page with an unpublished parent with strict hierarchy off' + ); + SiteTree::enforce_strict_hierarchy(false); } /**