Passed
Push — master ( e0f7b0...4354d2 )
by Vladimir
05:39 queued 20s
created

Test   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testCases() 0 10 1
A setUp() 0 3 1
A testCheck() 0 4 1
1
<?php
2
/**
3
 * This file is part of the `tvi/monitor-bundle` project.
4
 *
5
 * (c) https://github.com/turnaev/monitor-bundle/graphs/contributors
6
 *
7
 * For the full copyright and license information, please view the LICENSE.md
8
 * file that was distributed with this source code.
9
 */
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...
10
11
namespace Tvi\MonitorBundle\Check\php\ClassExists;
12
13
use PHPUnit\Framework\TestCase;
14
use ZendDiagnostics\Result\FailureInterface;
15
use ZendDiagnostics\Result\ResultInterface;
16
use Tvi\MonitorBundle\Check\CheckInterface;
17
use ZendDiagnostics\Result\SuccessInterface;
18
19
/**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
20
 * @author Vladimir Turnaev <[email protected]>
21
 */
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...
22
class Test extends TestCase
23
{
24
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
25
     * @var Check
26
     */
27
    protected $checker;
28
29
    public function setUp()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function setUp()
Loading history...
30
    {
31
        $this->checker = new Check(self::class);
32
    }
33
34
    public function testCheck()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function testCheck()
Loading history...
35
    {
36
        $this->assertInstanceOf(CheckInterface::class, $this->checker);
37
        $this->assertInstanceOf(ResultInterface::class, $this->checker->check());
38
    }
39
40
    public function testCases()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function testCases()
Loading history...
41
    {
42
        $checker = new Check(self::class);
43
        $this->assertInstanceOf(SuccessInterface::class, $checker->check());
44
45
        $checker = new Check('note_exuist_class');
46
        $this->assertInstanceOf(FailureInterface::class, $checker->check());
47
48
        $checker = new Check(['note_exuist_class', self::class]);
49
        $this->assertInstanceOf(FailureInterface::class, $checker->check());
50
    }
51
}
52