testCheckReportsMissingFunctions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SilverStripe\EnvironmentCheck\Tests\Checks;
4
5
use SilverStripe\EnvironmentCheck\Checks\HasFunctionCheck;
6
use SilverStripe\EnvironmentCheck\EnvironmentCheck;
7
use SilverStripe\Dev\SapphireTest;
8
9
/**
10
 * Class HasFunctionCheckTest
11
 *
12
 * @mixin PHPUnit_Framework_TestCase
13
 *
14
 * @package environmentcheck
15
 */
16
class HasFunctionCheckTest extends SapphireTest
17
{
18
    public function testCheckReportsMissingFunctions()
19
    {
20
        $check = new HasFunctionCheck('foo');
21
22
        $expected = [
23
            EnvironmentCheck::ERROR,
24
            'foo() doesn\'t exist'
25
        ];
26
27
        $this->assertEquals($expected, $check->check());
28
    }
29
30
    public function testCheckReportsFoundFunctions()
31
    {
32
        $check = new HasFunctionCheck('class_exists');
33
34
        $expected = [
35
            EnvironmentCheck::OK,
36
            'class_exists() exists'
37
        ];
38
39
        $this->assertEquals($expected, $check->check());
40
    }
41
}
42