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

tests/unit/Admin/Html/FormTest.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\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 =
31
		[
32
			'adminName' => 'Test',
33
			'adminUser' => 'test',
34
			'adminPassword' => 'test',
35
			'adminEmail' => '[email protected]'
36
		];
37
		$installer = $this->installerFactory();
0 ignored issues
show
The method installerFactory() does not seem to exist on object<Redaxscript\Tests\Admin\Html\FormTest>.

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...
38
		$installer->init();
39
		$installer->rawCreate();
40
		$installer->insertSettings($optionArray);
41
	}
42
43
	/**
44
	 * tearDown
45
	 *
46
	 * @since 3.1.0
47
	 */
48
49
	public function tearDown() : void
50
	{
51
		$this->dropDatabase();
0 ignored issues
show
The method dropDatabase() does not seem to exist on object<Redaxscript\Tests\Admin\Html\FormTest>.

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...
52
	}
53
54
	/**
55
	 * testCreate
56
	 *
57
	 * @since 3.0.0
58
	 *
59
	 * @param array $attributeArray
60
	 * @param array $optionArray
61
	 * @param string $expect
62
	 *
63
	 * @dataProvider providerAutoloader
64
	 */
65
66
	public function testCreate(array $attributeArray = [], array $optionArray = [], string $expect = null) : void
67
	{
68
		/* setup */
69
70
		$form = new Admin\Html\Form($this->_registry, $this->_language);
71
		$form->init($attributeArray, $optionArray);
72
73
		/* actual */
74
75
		$actual = $form;
76
77
		/* compare */
78
79
		$this->assertEquals($expect, $actual);
80
	}
81
}
82