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
|
|
|
*/ |
|
|
|
|
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
|
|
|
/** |
|
|
|
|
21
|
|
|
* @author Vladimir Turnaev <[email protected]> |
22
|
|
|
* |
23
|
|
|
* @internal |
24
|
|
|
*/ |
|
|
|
|
25
|
|
|
class Test extends CheckTestCase |
26
|
|
|
{ |
27
|
|
|
public function test_plugin() |
|
|
|
|
28
|
|
|
{ |
29
|
|
|
$this->iterateConfTest(__DIR__.'/config.example.yml'); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public function test_check() |
|
|
|
|
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() |
|
|
|
|
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
|
|
|
|