mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
Merge pull request #183 from tractorcow/pulls/1.0/update-test-permissions
Fix subsites to use correct permissions
This commit is contained in:
commit
d701afcb61
@ -9,6 +9,10 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest {
|
|||||||
'SiteTreeSubsitesTest_ClassB'
|
'SiteTreeSubsitesTest_ClassB'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
protected $illegalExtensions = array(
|
||||||
|
'SiteTree' => array('Translatable')
|
||||||
|
);
|
||||||
|
|
||||||
function testPagesInDifferentSubsitesCanShareURLSegment() {
|
function testPagesInDifferentSubsitesCanShareURLSegment() {
|
||||||
$subsiteMain = $this->objFromFixture('Subsite', 'main');
|
$subsiteMain = $this->objFromFixture('Subsite', 'main');
|
||||||
$subsite1 = $this->objFromFixture('Subsite', 'subsite1');
|
$subsite1 = $this->objFromFixture('Subsite', 'subsite1');
|
||||||
@ -129,7 +133,7 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testPageTypesBlacklistInClassDropdown() {
|
function testPageTypesBlacklistInClassDropdown() {
|
||||||
Session::set("loggedInAs", null);
|
$this->logInWithPermission('CMS_ACCESS_CMSMain');
|
||||||
|
|
||||||
$s1 = $this->objFromFixture('Subsite','domaintest1');
|
$s1 = $this->objFromFixture('Subsite','domaintest1');
|
||||||
$s2 = $this->objFromFixture('Subsite','domaintest2');
|
$s2 = $this->objFromFixture('Subsite','domaintest2');
|
||||||
@ -164,7 +168,7 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testPageTypesBlacklistInCMSMain() {
|
function testPageTypesBlacklistInCMSMain() {
|
||||||
Session::set("loggedInAs", null);
|
$this->logInWithPermission('CMS_ACCESS_CMSMain');
|
||||||
|
|
||||||
$cmsmain = new CMSMain();
|
$cmsmain = new CMSMain();
|
||||||
|
|
||||||
@ -175,16 +179,18 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest {
|
|||||||
$s1->write();
|
$s1->write();
|
||||||
|
|
||||||
Subsite::changeSubsite($s1);
|
Subsite::changeSubsite($s1);
|
||||||
$classes = $cmsmain->PageTypes()->column('ClassName');
|
$hints = Convert::json2array($cmsmain->SiteTreeHints());
|
||||||
$this->assertNotContains('ErrorPage', $classes);
|
$classes = $hints['Root']['disallowedChildren'];
|
||||||
$this->assertNotContains('SiteTreeSubsitesTest_ClassA', $classes);
|
|
||||||
$this->assertContains('SiteTreeSubsitesTest_ClassB', $classes);
|
|
||||||
|
|
||||||
Subsite::changeSubsite($s2);
|
|
||||||
$classes = $cmsmain->PageTypes()->column("ClassName");
|
|
||||||
$this->assertContains('ErrorPage', $classes);
|
$this->assertContains('ErrorPage', $classes);
|
||||||
$this->assertContains('SiteTreeSubsitesTest_ClassA', $classes);
|
$this->assertContains('SiteTreeSubsitesTest_ClassA', $classes);
|
||||||
$this->assertContains('SiteTreeSubsitesTest_ClassB', $classes);
|
$this->assertNotContains('SiteTreeSubsitesTest_ClassB', $classes);
|
||||||
|
|
||||||
|
Subsite::changeSubsite($s2);
|
||||||
|
$hints = Convert::json2array($cmsmain->SiteTreeHints());
|
||||||
|
$classes = $hints['Root']['disallowedChildren'];
|
||||||
|
$this->assertNotContains('ErrorPage', $classes);
|
||||||
|
$this->assertNotContains('SiteTreeSubsitesTest_ClassA', $classes);
|
||||||
|
$this->assertNotContains('SiteTreeSubsitesTest_ClassB', $classes);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user