1
|
|
|
<?php |
2
|
|
|
namespace Redaxscript\Tests\View; |
3
|
|
|
|
4
|
|
|
use Redaxscript\Tests\TestCaseAbstract; |
5
|
|
|
use Redaxscript\View; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* SystemStatusTest |
9
|
|
|
* |
10
|
|
|
* @since 3.0.0 |
11
|
|
|
* |
12
|
|
|
* @package Redaxscript |
13
|
|
|
* @category Tests |
14
|
|
|
* @author Henry Ruhs |
15
|
|
|
* |
16
|
|
|
* @covers Redaxscript\View\SystemStatus |
17
|
|
|
* @covers Redaxscript\View\ViewAbstract |
18
|
|
|
*/ |
19
|
|
|
|
20
|
|
|
class SystemStatusTest extends TestCaseAbstract |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* testRender |
24
|
|
|
* |
25
|
|
|
* @since 3.0.0 |
26
|
|
|
* |
27
|
|
|
* @param array $registryArray |
28
|
|
|
* @param string $expect |
29
|
|
|
* |
30
|
|
|
* @dataProvider providerAutoloader |
31
|
|
|
*/ |
32
|
|
|
|
33
|
|
|
public function testRender(array $registryArray = [], string $expect = null) : void |
34
|
|
|
{ |
35
|
|
|
/* setup */ |
36
|
|
|
|
37
|
|
|
$this->_registry->init($registryArray); |
38
|
|
|
$systemStatus = new View\SystemStatus($this->_registry, $this->_language); |
39
|
|
|
|
40
|
|
|
/* actual */ |
41
|
|
|
|
42
|
|
|
$actual = $systemStatus->render(); |
43
|
|
|
|
44
|
|
|
/* compare */ |
45
|
|
|
|
46
|
|
|
$this->assertEquals($expect, $actual); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* testValidateError |
51
|
|
|
* |
52
|
|
|
* @since 3.0.0 |
53
|
|
|
* |
54
|
|
|
* @param array $registryArray |
55
|
|
|
* @param array $expectArray |
56
|
|
|
* |
57
|
|
|
* @dataProvider providerAutoloader |
58
|
|
|
*/ |
59
|
|
|
|
60
|
|
|
public function testValidateError(array $registryArray = [], array $expectArray = []) : void |
61
|
|
|
{ |
62
|
|
|
/* setup */ |
63
|
|
|
|
64
|
|
|
$this->_registry->init($registryArray); |
65
|
|
|
$systemStatus = new View\SystemStatus($this->_registry, $this->_language); |
66
|
|
|
|
67
|
|
|
/* actual */ |
68
|
|
|
|
69
|
|
|
$actualArray = $this->callMethod($systemStatus, '_validateError'); |
70
|
|
|
|
71
|
|
|
/* compare */ |
72
|
|
|
|
73
|
|
|
$this->assertEquals($expectArray, $actualArray); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* testValidateWarning |
78
|
|
|
* |
79
|
|
|
* @since 3.0.0 |
80
|
|
|
* |
81
|
|
|
* @param array $registryArray |
82
|
|
|
* @param array $expectArray |
83
|
|
|
* |
84
|
|
|
* @dataProvider providerAutoloader |
85
|
|
|
*/ |
86
|
|
|
|
87
|
|
|
public function testValidateWarning(array $registryArray = [], array $expectArray = []) : void |
88
|
|
|
{ |
89
|
|
|
/* setup */ |
90
|
|
|
|
91
|
|
|
$this->_registry->init($registryArray); |
92
|
|
|
$systemStatus = new View\SystemStatus($this->_registry, $this->_language); |
93
|
|
|
|
94
|
|
|
/* actual */ |
95
|
|
|
|
96
|
|
|
$actualArray = $this->callMethod($systemStatus, '_validateWarning'); |
97
|
|
|
|
98
|
|
|
/* compare */ |
99
|
|
|
|
100
|
|
|
$this->assertEquals($expectArray, $actualArray); |
101
|
|
|
} |
102
|
|
|
} |
103
|
|
|
|