Skip to content

Commit

Permalink
MINOR more unit tests around loose hierarchy (from r98509) (from r99121)
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@111605 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
Sam Minnee committed Oct 4, 2010
1 parent 4c51062 commit 2d02afc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/CMSMainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,24 @@ function testThatGetCMSFieldsWorksOnEveryPageType() {

$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);
}

/**
Expand Down

0 comments on commit 2d02afc

Please sign in to comment.