FormTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 57
rs 10
c 0
b 0
f 0

3 Methods

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