Completed
Pull Request — master (#47)
by Robbie
01:29
created

ControllerTest::tearDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace LeKoala\DebugBar\Test;
4
5
use LeKoala\DebugBar\DebugBar;
6
use SilverStripe\Core\Config\Config;
7
use SilverStripe\Dev\FunctionalTest;
8
9
class ControllerTest extends FunctionalTest
10
{
11
    public function tearDown()
12
    {
13
        parent::tearDown();
14
        DebugBar::clearDebugBar();
15
    }
16
17 View Code Duplication
    public function testErrorWhenStorageIsDisabled()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
    {
19
        Config::modify()->set(DebugBar::class, 'enable_storage', false);
20
        $result = $this->get('/__debugbar');
21
        $this->assertEquals(404, $result->getStatusCode());
22
        $this->assertEquals('Storage not enabled', (string) $result->getBody());
23
    }
24
25 View Code Duplication
    public function testErrorWhenModuleIsDisabled()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
    {
27
        Config::modify()->set(DebugBar::class, 'disabled', true);
28
        $result = $this->get('/__debugbar');
29
        $this->assertEquals(404, $result->getStatusCode());
30
        $this->assertEquals('DebugBar not enabled', (string) $result->getBody());
31
    }
32
}
33