@@ -9,26 +9,26 @@ |
||
9 | 9 | |
10 | 10 | class SitemapPageTest extends FunctionalTest |
11 | 11 | { |
12 | - protected static $fixture_file = 'SitemapPageTest.yml'; |
|
12 | + protected static $fixture_file = 'SitemapPageTest.yml'; |
|
13 | 13 | |
14 | - protected static $use_draft_site = true; |
|
14 | + protected static $use_draft_site = true; |
|
15 | 15 | |
16 | - protected function setUp() |
|
17 | - { |
|
18 | - parent::setUp(); |
|
16 | + protected function setUp() |
|
17 | + { |
|
18 | + parent::setUp(); |
|
19 | 19 | |
20 | - Config::inst()->update(SSViewer::class, 'theme', 'starter'); |
|
21 | - } |
|
20 | + Config::inst()->update(SSViewer::class, 'theme', 'starter'); |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * Note: this test depends on the "starter" theme being installed and configured as default |
|
25 | - */ |
|
26 | - public function testSitemapShowsNavigationTitleNotNormalTitle() |
|
27 | - { |
|
28 | - $response = $this->get('sitemap'); |
|
29 | - $parser = new CSSContentParser($response->getBody()); |
|
30 | - $elements = $parser->getBySelector('.sitemap li.first .sitemap-link'); |
|
31 | - $this->assertNotEmpty($elements); |
|
32 | - $this->assertEquals('Top page nav 1', (string) $elements[0]); |
|
33 | - } |
|
23 | + /** |
|
24 | + * Note: this test depends on the "starter" theme being installed and configured as default |
|
25 | + */ |
|
26 | + public function testSitemapShowsNavigationTitleNotNormalTitle() |
|
27 | + { |
|
28 | + $response = $this->get('sitemap'); |
|
29 | + $parser = new CSSContentParser($response->getBody()); |
|
30 | + $elements = $parser->getBySelector('.sitemap li.first .sitemap-link'); |
|
31 | + $this->assertNotEmpty($elements); |
|
32 | + $this->assertEquals('Top page nav 1', (string) $elements[0]); |
|
33 | + } |
|
34 | 34 | } |
@@ -15,34 +15,34 @@ |
||
15 | 15 | class WorkflowDefinitionExtensionTest extends FunctionalTest |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * @var Boolean If set to TRUE, this will force a test database to be generated |
|
20 | - * in {@link setUp()}. Note that this flag is overruled by the presence of a |
|
21 | - * {@link $fixture_file}, which always forces a database build. |
|
22 | - */ |
|
23 | - protected $usesDatabase = true; |
|
18 | + /** |
|
19 | + * @var Boolean If set to TRUE, this will force a test database to be generated |
|
20 | + * in {@link setUp()}. Note that this flag is overruled by the presence of a |
|
21 | + * {@link $fixture_file}, which always forces a database build. |
|
22 | + */ |
|
23 | + protected $usesDatabase = true; |
|
24 | 24 | |
25 | - /** |
|
26 | - * Tests the config option that controls the creation of a default workflow definition |
|
27 | - * |
|
28 | - * @return void |
|
29 | - */ |
|
30 | - public function testCreateDefaultWorkflowTest() |
|
31 | - { |
|
32 | - DB::quiet(); |
|
25 | + /** |
|
26 | + * Tests the config option that controls the creation of a default workflow definition |
|
27 | + * |
|
28 | + * @return void |
|
29 | + */ |
|
30 | + public function testCreateDefaultWorkflowTest() |
|
31 | + { |
|
32 | + DB::quiet(); |
|
33 | 33 | |
34 | - // test disabling the default workflow definition |
|
35 | - Config::modify()->set(CwpWorkflowDefinitionExtension::class, 'create_default_workflow', false); |
|
36 | - $workflowExtn = Injector::inst()->create(CwpWorkflowDefinitionExtension::class); |
|
37 | - $workflowExtn->requireDefaultRecords(); |
|
38 | - $definition = WorkflowDefinition::get()->first(); |
|
39 | - $this->assertNull($definition); |
|
34 | + // test disabling the default workflow definition |
|
35 | + Config::modify()->set(CwpWorkflowDefinitionExtension::class, 'create_default_workflow', false); |
|
36 | + $workflowExtn = Injector::inst()->create(CwpWorkflowDefinitionExtension::class); |
|
37 | + $workflowExtn->requireDefaultRecords(); |
|
38 | + $definition = WorkflowDefinition::get()->first(); |
|
39 | + $this->assertNull($definition); |
|
40 | 40 | |
41 | - // test enabling the default workflow definition |
|
42 | - Config::modify()->set(CwpWorkflowDefinitionExtension::class, 'create_default_workflow', true); |
|
43 | - $workflowExtn = Injector::inst()->create(CwpWorkflowDefinitionExtension::class); |
|
44 | - $workflowExtn->requireDefaultRecords(); |
|
45 | - $definition = WorkflowDefinition::get()->first(); |
|
46 | - $this->assertNotNull($definition); |
|
47 | - } |
|
41 | + // test enabling the default workflow definition |
|
42 | + Config::modify()->set(CwpWorkflowDefinitionExtension::class, 'create_default_workflow', true); |
|
43 | + $workflowExtn = Injector::inst()->create(CwpWorkflowDefinitionExtension::class); |
|
44 | + $workflowExtn->requireDefaultRecords(); |
|
45 | + $definition = WorkflowDefinition::get()->first(); |
|
46 | + $this->assertNotNull($definition); |
|
47 | + } |
|
48 | 48 | } |
@@ -7,51 +7,51 @@ discard block |
||
7 | 7 | |
8 | 8 | class SynonymValidatorTest extends SapphireTest |
9 | 9 | { |
10 | - /** |
|
11 | - * @var SynonymValidator |
|
12 | - */ |
|
13 | - protected $validator; |
|
10 | + /** |
|
11 | + * @var SynonymValidator |
|
12 | + */ |
|
13 | + protected $validator; |
|
14 | 14 | |
15 | - protected function setUp() |
|
16 | - { |
|
17 | - parent::setUp(); |
|
15 | + protected function setUp() |
|
16 | + { |
|
17 | + parent::setUp(); |
|
18 | 18 | |
19 | - $this->validator = new SynonymValidator([ |
|
20 | - 'Synonyms', |
|
21 | - ]); |
|
22 | - } |
|
19 | + $this->validator = new SynonymValidator([ |
|
20 | + 'Synonyms', |
|
21 | + ]); |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * @dataProvider validValuesProvider |
|
26 | - */ |
|
27 | - public function testItAllowsValidValues($value) |
|
28 | - { |
|
29 | - $this->validator->php([ |
|
30 | - 'Synonyms' => $value, |
|
31 | - ]); |
|
24 | + /** |
|
25 | + * @dataProvider validValuesProvider |
|
26 | + */ |
|
27 | + public function testItAllowsValidValues($value) |
|
28 | + { |
|
29 | + $this->validator->php([ |
|
30 | + 'Synonyms' => $value, |
|
31 | + ]); |
|
32 | 32 | |
33 | - $this->assertEmpty($this->validator->getErrors()); |
|
34 | - } |
|
33 | + $this->assertEmpty($this->validator->getErrors()); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * @return array |
|
38 | - */ |
|
39 | - public function validValuesProvider() |
|
40 | - { |
|
41 | - return [ |
|
42 | - ['foo'], |
|
43 | - ['foo,bar,baz'], |
|
44 | - ['foo, bar, baz'], |
|
45 | - [ |
|
46 | - ' |
|
36 | + /** |
|
37 | + * @return array |
|
38 | + */ |
|
39 | + public function validValuesProvider() |
|
40 | + { |
|
41 | + return [ |
|
42 | + ['foo'], |
|
43 | + ['foo,bar,baz'], |
|
44 | + ['foo, bar, baz'], |
|
45 | + [ |
|
46 | + ' |
|
47 | 47 | foo |
48 | 48 | bar |
49 | 49 | baz |
50 | 50 | ' |
51 | - ], |
|
52 | - ['foo => bar, baz'], |
|
53 | - [ |
|
54 | - ' |
|
51 | + ], |
|
52 | + ['foo => bar, baz'], |
|
53 | + [ |
|
54 | + ' |
|
55 | 55 | # this is a comment, it should be ignored! |
56 | 56 | |
57 | 57 | foo, bar, baz |
@@ -59,32 +59,32 @@ discard block |
||
59 | 59 | |
60 | 60 | # ...as should this. |
61 | 61 | ' |
62 | - ], |
|
63 | - ]; |
|
64 | - } |
|
62 | + ], |
|
63 | + ]; |
|
64 | + } |
|
65 | 65 | |
66 | - /** |
|
67 | - * @dataProvider invalidValuesProvider |
|
68 | - * |
|
69 | - * @param string $value |
|
70 | - */ |
|
71 | - public function testItDisallowsInvalidValues($value) |
|
72 | - { |
|
73 | - $this->validator->php([ |
|
74 | - 'Synonyms' => $value, |
|
75 | - ]); |
|
66 | + /** |
|
67 | + * @dataProvider invalidValuesProvider |
|
68 | + * |
|
69 | + * @param string $value |
|
70 | + */ |
|
71 | + public function testItDisallowsInvalidValues($value) |
|
72 | + { |
|
73 | + $this->validator->php([ |
|
74 | + 'Synonyms' => $value, |
|
75 | + ]); |
|
76 | 76 | |
77 | - $this->assertNotEmpty($this->validator->getErrors()); |
|
78 | - } |
|
77 | + $this->assertNotEmpty($this->validator->getErrors()); |
|
78 | + } |
|
79 | 79 | |
80 | - /** |
|
81 | - * @return array |
|
82 | - */ |
|
83 | - public function invalidValuesProvider() |
|
84 | - { |
|
85 | - return [ |
|
86 | - ['foo, bar baz, qux'], |
|
87 | - ['foo => bar baz, qux'], |
|
88 | - ]; |
|
89 | - } |
|
80 | + /** |
|
81 | + * @return array |
|
82 | + */ |
|
83 | + public function invalidValuesProvider() |
|
84 | + { |
|
85 | + return [ |
|
86 | + ['foo, bar baz, qux'], |
|
87 | + ['foo => bar baz, qux'], |
|
88 | + ]; |
|
89 | + } |
|
90 | 90 | } |