Test   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A test_check() 0 5 1
A test_cases() 0 10 1
A test_plugin() 0 3 1
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]>
22
 *
23
 * @internal
24
 */
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...
25
class Test extends CheckTestCase
26
{
27
    public function test_plugin()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function test_plugin()
Loading history...
Coding Style introduced by
Public method name "Test::test_plugin" is not in camel caps format
Loading history...
28
    {
29
        $this->iterateConfTest(__DIR__.'/config.example.yml');
30
    }
31
32
    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...
33
    {
34
        $check = new Check(self::class);
35
        $this->assertInstanceOf(CheckInterface::class, $check);
36
        $this->assertInstanceOf(ResultInterface::class, $check->check());
37
    }
38
39
    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...
40
    {
41
        $check = new Check(self::class);
42
        $this->assertInstanceOf(SuccessInterface::class, $check->check());
43
44
        $check = new Check('note_exuist_class');
45
        $this->assertInstanceOf(FailureInterface::class, $check->check());
46
47
        $check = new Check(['note_exuist_class', self::class]);
48
        $this->assertInstanceOf(FailureInterface::class, $check->check());
49
    }
50
}
51