PanelTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 58
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A tearDown() 0 5 1
A testRender() 0 18 1
1
<?php
2
namespace Redaxscript\Tests\Admin\View\Helper;
3
4
use Redaxscript\Admin;
5
use Redaxscript\Module;
6
use Redaxscript\Tests\TestCaseAbstract;
7
8
/**
9
 * PanelTest
10
 *
11
 * @since 4.0.0
12
 *
13
 * @package Redaxscript
14
 * @category Tests
15
 * @author Henry Ruhs
16
 *
17
 * @covers Redaxscript\Admin\View\Helper\Panel
18
 */
19
20
class PanelTest extends TestCaseAbstract
21
{
22
	/**
23
	 * setUp
24
	 *
25
	 * @since 4.0.0
26
	 */
27
28
	public function setUp() : void
29
	{
30
		parent::setUp();
31
		$this->createDatabase();
32
		$this->installTestDummy();
33
	}
34
35
	/**
36
	 * tearDown
37
	 *
38
	 * @since 4.0.0
39
	 */
40
41
	public function tearDown() : void
42
	{
43
		$this->uninstallTestDummy();
44
		$this->dropDatabase();
45
	}
46
47
	/**
48
	 * testRender
49
	 *
50
	 * @since 4.0.0
51
	 *
52
	 * @param array $registryArray
53
	 * @param array $optionArray
54
	 * @param string $expect
55
	 *
56
	 * @dataProvider providerAutoloader
57
	 */
58
59
	public function testRender(array $registryArray = [], array $optionArray = [], string $expect = null) : void
60
	{
61
		/* setup */
62
63
		Module\Hook::construct($this->_registry, $this->_request, $this->_language, $this->_config);
64
		Module\Hook::init();
65
		$this->_registry->init($registryArray);
66
		$adminPanel = new Admin\View\Helper\Panel($this->_registry, $this->_language);
67
		$adminPanel->init($optionArray);
68
69
		/* actual */
70
71
		$actual = $adminPanel->render();
72
73
		/* compare */
74
75
		$this->assertEquals($expect, $actual);
76
	}
77
}
78