testCheckReportsNonWritablePaths()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 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
class FileWritableCheckTest extends SapphireTest
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