Completed
Branch master (9dcfc4)
by Daniel
24:32
created

testCheckReportsNonWritablePaths()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace SilverStripe\EnvironmentCheck\Tests\Checks;
4
5
use SilverStripe\EnvironmentCheck\Checks\FileWriteableCheck;
6
use SilverStripe\EnvironmentCheck\EnvironmentCheck;
7
use SilverStripe\Dev\SapphireTest;
8
9
/**
10
 * Class FileWritableCheckTest
11
 *
12
 * @mixin PHPUnit_Framework_TestCase
13
 *
14
 * @package environmentcheck
15
 */
16 View Code Duplication
class FileWritableCheckTest extends SapphireTest
0 ignored issues
show
Duplication introduced by
This class 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...
17
{
18
    public function testCheckReportsWritablePaths()
19
    {
20
        $check = new FileWriteableCheck(TEMP_FOLDER);
21
22
        $expected = [
23
            EnvironmentCheck::OK,
24
            ''
25
        ];
26
27
        $this->assertEquals($expected, $check->check());
28
    }
29
30
    public function testCheckReportsNonWritablePaths()
31
    {
32
        $check = new FileWriteableCheck('/var');
33
34
        $result = $check->check();
35
36
        $this->assertEquals(EnvironmentCheck::ERROR, $result[0]);
37
    }
38
}
39