@@ 28-40 (lines=13) @@ | ||
25 | static::setUpAfterClass(); // TODO: Change the autogenerated stub |
|
26 | } |
|
27 | ||
28 | public function testCanCreateRootPages() |
|
29 | { |
|
30 | $config = $this->objFromFixture('SilverStripe\\SiteConfig\\SiteConfig', 'default'); |
|
31 | ||
32 | // Log in without pages admin access |
|
33 | $this->logInWithPermission('CMS_ACCESS_AssetAdmin'); |
|
34 | $this->assertFalse($config->canCreateTopLevel()); |
|
35 | ||
36 | // Login with necessary edit permission |
|
37 | $perms = SiteConfig::config()->required_permission; |
|
38 | $this->logInWithPermission(reset($perms)); |
|
39 | $this->assertTrue($config->canCreateTopLevel()); |
|
40 | } |
|
41 | ||
42 | public function testCanViewPages() |
|
43 | { |
|
@@ 61-73 (lines=13) @@ | ||
58 | $this->assertTrue($config->canEdit()); |
|
59 | } |
|
60 | ||
61 | public function testCanEditPages() |
|
62 | { |
|
63 | $config = $this->objFromFixture('SilverStripe\\SiteConfig\\SiteConfig', 'default'); |
|
64 | ||
65 | // Log in without pages admin access |
|
66 | $this->logInWithPermission('CMS_ACCESS_AssetAdmin'); |
|
67 | $this->assertFalse($config->canEditPages()); |
|
68 | ||
69 | // Login with necessary edit permission |
|
70 | $perms = SiteConfig::config()->required_permission; |
|
71 | $this->logInWithPermission(reset($perms)); |
|
72 | $this->assertTrue($config->canEditPages()); |
|
73 | } |
|
74 | } |
|
75 |