Completed
Push — master ( 06434b...4c940d )
by Robbie
21s queued 11s
created

EnablerExtensionTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 15
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace SilverStripe\LoginForms\Tests;
4
5
use SilverStripe\Control\HTTPRequest;
0 ignored issues
show
Bug introduced by
The type SilverStripe\Control\HTTPRequest was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use SilverStripe\Core\Config\Config;
0 ignored issues
show
Bug introduced by
The type SilverStripe\Core\Config\Config was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use SilverStripe\Dev\FunctionalTest;
0 ignored issues
show
Bug introduced by
The type SilverStripe\Dev\FunctionalTest was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use SilverStripe\LoginForms\EnablerExtension;
9
use SilverStripe\Security\Security;
0 ignored issues
show
Bug introduced by
The type SilverStripe\Security\Security was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use SilverStripe\View\SSViewer;
0 ignored issues
show
Bug introduced by
The type SilverStripe\View\SSViewer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
12
class EnablerExtensionTest extends FunctionalTest
13
{
14
    protected function setUp()
15
    {
16
        parent::setUp();
17
        $config = Config::modify();
18
        $config->set(SSViewer::class, 'themes', [
19
            '$public',
20
            '$default',
21
        ]);
22
        $config->set(EnablerExtension::class, 'login_themes', [
23
            'silverstripe/login-forms:login-forms',
24
            '$default',
25
        ]);
26
        $config->set(EnablerExtension::class, 'excluded_actions', [
27
            'index',
28
            'ping',
29
        ]);
30
    }
31
32
    public function testThatSecurityActionsHaveUpdatedThemeListApplied()
33
    {
34
        $this->get(Security::login_url());
35
        $this->assertContains('silverstripe/login-forms:login-forms', SSViewer::get_themes());
36
    }
37
38
    public function testThatExcludedActionsDoNotHaveTheUpdatedThemeListApplied()
39
    {
40
        $this->get('Security/index');
41
        $this->assertNotContains('silverstripe/login-forms:login-forms', SSViewer::get_themes());
42
    }
43
}
44