Permalink
Browse files

MINOR Fixed merge error

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102349 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 007b309 commit 8618c3ce878b90f8add3d5774eb7adab3504d557 @chillu chillu committed Apr 12, 2010
Showing with 0 additions and 51 deletions.
  1. +0 −51 tests/SiteTreePermissionsTest.php
View
51 tests/SiteTreePermissionsTest.php
@@ -336,57 +336,6 @@ function testInheritCanEditFromSiteConfig() {
$this->session()->inst_set('loggedInAs', $user->ID);
$this->assertFalse($page->canEdit($user), 'Website user can\'t edit a page when set to inherit from the SiteConfig, and SiteConfig has canEdit set to OnlyTheseUsers');
}
-
- function testInheritCanViewFromSiteConfig() {
- $page = $this->objFromFixture('Page', 'inheritWithNoParent');
- $siteconfig = $this->objFromFixture('SiteConfig', 'default');
- $editor = $this->objFromFixture('Member', 'editor');
- $editorGroup = $this->objFromFixture('Group', 'editorgroup');
-
- $siteconfig->CanViewType = 'Anyone';
- $siteconfig->write();
- $this->assertTrue($page->canView(FALSE), 'Anyone can view a page when set to inherit from the SiteConfig, and SiteConfig has canView set to LoggedInUsers');
-
- $siteconfig->CanViewType = 'LoggedInUsers';
- $siteconfig->write();
- $this->assertFalse($page->canView(FALSE), 'Anonymous can\'t view a page when set to inherit from the SiteConfig, and SiteConfig has canView set to LoggedInUsers');
-
- $siteconfig->CanViewType = 'LoggedInUsers';
- $siteconfig->write();
- $this->assertTrue($page->canView($editor), 'Users can view a page when set to inherit from the SiteConfig, and SiteConfig has canView set to LoggedInUsers');
-
- $siteconfig->CanViewType = 'OnlyTheseUsers';
- $siteconfig->ViewerGroups()->add($editorGroup);
- $siteconfig->ViewerGroups()->write();
- $siteconfig->write();
- $this->assertTrue($page->canView($editor), 'Editors can view a page when set to inherit from the SiteConfig, and SiteConfig has canView set to OnlyTheseUsers');
- $this->assertFalse($page->canView(FALSE), 'Anonymous can\'t view a page when set to inherit from the SiteConfig, and SiteConfig has canView set to OnlyTheseUsers');
- }
-
- function testInheritCanEditFromSiteConfig() {
- $page = $this->objFromFixture('Page', 'inheritWithNoParent');
- $siteconfig = $this->objFromFixture('SiteConfig', 'default');
- $editor = $this->objFromFixture('Member', 'editor');
- $user = $this->objFromFixture('Member', 'websiteuser');
- $editorGroup = $this->objFromFixture('Group', 'editorgroup');
-
- $siteconfig->CanEditType = 'LoggedInUsers';
- $siteconfig->write();
-
- $this->assertFalse($page->canEdit(FALSE), 'Anonymous can\'t edit a page when set to inherit from the SiteConfig, and SiteConfig has canEdit set to LoggedInUsers');
- $this->session()->inst_set('loggedInAs', $editor->ID);
- $this->assertTrue($page->canEdit(), 'Users can edit a page when set to inherit from the SiteConfig, and SiteConfig has canEdit set to LoggedInUsers');
-
- $siteconfig->CanEditType = 'OnlyTheseUsers';
- $siteconfig->EditorGroups()->add($editorGroup);
- $siteconfig->EditorGroups()->write();
- $siteconfig->write();
- $this->assertTrue($page->canEdit($editor), 'Editors can edit a page when set to inherit from the SiteConfig, and SiteConfig has canEdit set to OnlyTheseUsers');
- $this->session()->inst_set('loggedInAs', null);
- $this->assertFalse($page->canEdit(FALSE), 'Anonymous can\'t edit a page when set to inherit from the SiteConfig, and SiteConfig has canEdit set to OnlyTheseUsers');
- $this->session()->inst_set('loggedInAs', $user->ID);
- $this->assertFalse($page->canEdit($user), 'Website user can\'t edit a page when set to inherit from the SiteConfig, and SiteConfig has canEdit set to OnlyTheseUsers');
- }
}
?>

0 comments on commit 8618c3c

Please sign in to comment.