Passed
Push — master ( 2084ff...487134 )
by Vladimir
04:34
created

Test::testCases()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of the `tvi/monitor-bundle` project.
5
 *
6
 * (c) https://github.com/turnaev/monitor-bundle/graphs/contributors
7
 *
8
 * For the full copyright and license information, please view the LICENSE.md
9
 * file that was distributed with this source code.
10
 */
0 ignored issues
show
Coding Style introduced by
PHP version not specified
Loading history...
Coding Style introduced by
Missing @category tag in file comment
Loading history...
Coding Style introduced by
Missing @package tag in file comment
Loading history...
Coding Style introduced by
Missing @author tag in file comment
Loading history...
Coding Style introduced by
Missing @license tag in file comment
Loading history...
Coding Style introduced by
Missing @link tag in file comment
Loading history...
11
12
namespace Tvi\MonitorBundle\Check\php\ClassExists;
13
14
use Tvi\MonitorBundle\Check\CheckInterface;
15
use Tvi\MonitorBundle\Test\Check\CheckTestCase;
16
use ZendDiagnostics\Result\FailureInterface;
17
use ZendDiagnostics\Result\ResultInterface;
18
use ZendDiagnostics\Result\SuccessInterface;
19
20
/**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
21
 * @author Vladimir Turnaev <[email protected]>
0 ignored issues
show
Coding Style introduced by
Tag value indented incorrectly; expected 8 spaces but found 1
Loading history...
22
 * @coversNothing
23
 *
24
 * @internal
25
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
26
class Test extends CheckTestCase
27
{
28
    public function test_integration()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function test_integration()
Loading history...
Coding Style introduced by
Public method name "Test::test_integration" is not in camel caps format
Loading history...
29
    {
30
        $this->iterateConfTest(__DIR__.'/config.example.yml');
31
    }
32
33
    public function test_check()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function test_check()
Loading history...
Coding Style introduced by
Public method name "Test::test_check" is not in camel caps format
Loading history...
34
    {
35
        $check = new Check(self::class);
36
        $this->assertInstanceOf(CheckInterface::class, $check);
37
        $this->assertInstanceOf(ResultInterface::class, $check->check());
38
    }
39
40
    public function test_cases()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function test_cases()
Loading history...
Coding Style introduced by
Public method name "Test::test_cases" is not in camel caps format
Loading history...
41
    {
42
        $check = new Check(self::class);
43
        $this->assertInstanceOf(SuccessInterface::class, $check->check());
44
45
        $check = new Check('note_exuist_class');
46
        $this->assertInstanceOf(FailureInterface::class, $check->check());
47
48
        $check = new Check(['note_exuist_class', self::class]);
49
        $this->assertInstanceOf(FailureInterface::class, $check->check());
50
    }
51
}
52