@@ -9,66 +9,66 @@ |
||
9 | 9 | */ |
10 | 10 | class SiteConfigTest extends SapphireTest |
11 | 11 | { |
12 | - protected static $fixture_file = 'SiteConfigTest.yml'; |
|
12 | + protected static $fixture_file = 'SiteConfigTest.yml'; |
|
13 | 13 | |
14 | - protected static $illegal_extensions = array( |
|
15 | - 'SilverStripe\\CMS\\Model\\SiteTree' => array('SiteTreeSubsites'), |
|
16 | - ); |
|
14 | + protected static $illegal_extensions = array( |
|
15 | + 'SilverStripe\\CMS\\Model\\SiteTree' => array('SiteTreeSubsites'), |
|
16 | + ); |
|
17 | 17 | |
18 | - public static function setUpAfterClass() |
|
19 | - { |
|
20 | - // Fix issue with tests failing without CMS module |
|
21 | - if (!class_exists('SilverStripe\\CMS\\Model\\SiteTree')) { |
|
22 | - unset(static::$illegal_extensions['SilverStripe\\CMS\\Model\\SiteTree']); |
|
23 | - } |
|
18 | + public static function setUpAfterClass() |
|
19 | + { |
|
20 | + // Fix issue with tests failing without CMS module |
|
21 | + if (!class_exists('SilverStripe\\CMS\\Model\\SiteTree')) { |
|
22 | + unset(static::$illegal_extensions['SilverStripe\\CMS\\Model\\SiteTree']); |
|
23 | + } |
|
24 | 24 | |
25 | - static::setUpAfterClass(); // TODO: Change the autogenerated stub |
|
26 | - } |
|
25 | + static::setUpAfterClass(); // TODO: Change the autogenerated stub |
|
26 | + } |
|
27 | 27 | |
28 | - public function testCanCreateRootPages() |
|
29 | - { |
|
30 | - $config = $this->objFromFixture('SilverStripe\\SiteConfig\\SiteConfig', 'default'); |
|
28 | + public function testCanCreateRootPages() |
|
29 | + { |
|
30 | + $config = $this->objFromFixture('SilverStripe\\SiteConfig\\SiteConfig', 'default'); |
|
31 | 31 | |
32 | - // Log in without pages admin access |
|
33 | - $this->logInWithPermission('CMS_ACCESS_AssetAdmin'); |
|
34 | - $this->assertFalse($config->canCreateTopLevel()); |
|
32 | + // Log in without pages admin access |
|
33 | + $this->logInWithPermission('CMS_ACCESS_AssetAdmin'); |
|
34 | + $this->assertFalse($config->canCreateTopLevel()); |
|
35 | 35 | |
36 | - // Login with necessary edit permission |
|
37 | - $perms = SiteConfig::config()->required_permission; |
|
38 | - $this->logInWithPermission(reset($perms)); |
|
39 | - $this->assertTrue($config->canCreateTopLevel()); |
|
40 | - } |
|
36 | + // Login with necessary edit permission |
|
37 | + $perms = SiteConfig::config()->required_permission; |
|
38 | + $this->logInWithPermission(reset($perms)); |
|
39 | + $this->assertTrue($config->canCreateTopLevel()); |
|
40 | + } |
|
41 | 41 | |
42 | - public function testCanViewPages() |
|
43 | - { |
|
44 | - $config = $this->objFromFixture('SilverStripe\\SiteConfig\\SiteConfig', 'default'); |
|
45 | - $this->assertTrue($config->canViewPages()); |
|
46 | - } |
|
42 | + public function testCanViewPages() |
|
43 | + { |
|
44 | + $config = $this->objFromFixture('SilverStripe\\SiteConfig\\SiteConfig', 'default'); |
|
45 | + $this->assertTrue($config->canViewPages()); |
|
46 | + } |
|
47 | 47 | |
48 | - public function testCanEdit() |
|
49 | - { |
|
50 | - $config = $this->objFromFixture('SilverStripe\\SiteConfig\\SiteConfig', 'default'); |
|
48 | + public function testCanEdit() |
|
49 | + { |
|
50 | + $config = $this->objFromFixture('SilverStripe\\SiteConfig\\SiteConfig', 'default'); |
|
51 | 51 | |
52 | - // Unrelated permissions don't allow siteconfig |
|
53 | - $this->logInWithPermission('CMS_ACCESS_AssetAdmin'); |
|
54 | - $this->assertFalse($config->canEdit()); |
|
52 | + // Unrelated permissions don't allow siteconfig |
|
53 | + $this->logInWithPermission('CMS_ACCESS_AssetAdmin'); |
|
54 | + $this->assertFalse($config->canEdit()); |
|
55 | 55 | |
56 | - // Only those with edit permission can do this |
|
57 | - $this->logInWithPermission('EDIT_SITECONFIG'); |
|
58 | - $this->assertTrue($config->canEdit()); |
|
59 | - } |
|
56 | + // Only those with edit permission can do this |
|
57 | + $this->logInWithPermission('EDIT_SITECONFIG'); |
|
58 | + $this->assertTrue($config->canEdit()); |
|
59 | + } |
|
60 | 60 | |
61 | - public function testCanEditPages() |
|
62 | - { |
|
63 | - $config = $this->objFromFixture('SilverStripe\\SiteConfig\\SiteConfig', 'default'); |
|
61 | + public function testCanEditPages() |
|
62 | + { |
|
63 | + $config = $this->objFromFixture('SilverStripe\\SiteConfig\\SiteConfig', 'default'); |
|
64 | 64 | |
65 | - // Log in without pages admin access |
|
66 | - $this->logInWithPermission('CMS_ACCESS_AssetAdmin'); |
|
67 | - $this->assertFalse($config->canEditPages()); |
|
65 | + // Log in without pages admin access |
|
66 | + $this->logInWithPermission('CMS_ACCESS_AssetAdmin'); |
|
67 | + $this->assertFalse($config->canEditPages()); |
|
68 | 68 | |
69 | - // Login with necessary edit permission |
|
70 | - $perms = SiteConfig::config()->required_permission; |
|
71 | - $this->logInWithPermission(reset($perms)); |
|
72 | - $this->assertTrue($config->canEditPages()); |
|
73 | - } |
|
69 | + // Login with necessary edit permission |
|
70 | + $perms = SiteConfig::config()->required_permission; |
|
71 | + $this->logInWithPermission(reset($perms)); |
|
72 | + $this->assertTrue($config->canEditPages()); |
|
73 | + } |
|
74 | 74 | } |