Completed
Push — master ( 16ddfb...0ea243 )
by Henry
09:18
created

tests/unit/View/SystemStatusTest.php (2 issues)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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');
0 ignored issues
show
The method callMethod() does not seem to exist on object<Redaxscript\Tests\View\SystemStatusTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
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');
0 ignored issues
show
The method callMethod() does not seem to exist on object<Redaxscript\Tests\View\SystemStatusTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
97
98
		/* compare */
99
100
		$this->assertEquals($expectArray, $actualArray);
101
	}
102
}
103