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

tests/unit/View/ResetFormTest.php (3 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
 * ResetFormTest
9
 *
10
 * @since 3.0.0
11
 *
12
 * @package Redaxscript
13
 * @category Tests
14
 * @author Henry Ruhs
15
 *
16
 * @covers Redaxscript\View\ResetForm
17
 * @covers Redaxscript\View\ViewAbstract
18
 */
19
20
class ResetFormTest extends TestCaseAbstract
21
{
22
	/**
23
	 * setUp
24
	 *
25
	 * @since 3.1.0
26
	 */
27
28
	public function setUp() : void
29
	{
30
		parent::setUp();
31
		$optionArray =
32
		[
33
			'adminName' => 'Test',
34
			'adminUser' => 'test',
35
			'adminPassword' => 'test',
36
			'adminEmail' => '[email protected]'
37
		];
38
		$installer = $this->installerFactory();
0 ignored issues
show
The method installerFactory() does not seem to exist on object<Redaxscript\Tests\View\ResetFormTest>.

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...
39
		$installer->init();
40
		$installer->rawCreate();
41
		$installer->insertSettings($optionArray);
42
		$setting = $this->settingFactory();
0 ignored issues
show
The method settingFactory() does not seem to exist on object<Redaxscript\Tests\View\ResetFormTest>.

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...
43
		$setting->set('captcha', 1);
44
	}
45
46
	/**
47
	 * tearDown
48
	 *
49
	 * @since 3.1.0
50
	 */
51
52
	public function tearDown() : void
53
	{
54
		$this->dropDatabase();
0 ignored issues
show
The method dropDatabase() does not seem to exist on object<Redaxscript\Tests\View\ResetFormTest>.

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...
55
	}
56
57
	/**
58
	 * testRender
59
	 *
60
	 * @since 3.0.0
61
	 *
62
	 * @param array $expectArray
63
	 *
64
	 * @dataProvider providerAutoloader
65
	 */
66
67
	public function testRender(array $expectArray = []) : void
68
	{
69
		/* setup */
70
71
		$resetForm = new View\ResetForm($this->_registry, $this->_language);
72
73
		/* actual */
74
75
		$actual = $resetForm->render();
76
77
		/* compare */
78
79
		$this->assertStringStartsWith($expectArray['start'], $actual);
80
		$this->assertStringEndsWith($expectArray['end'], $actual);
81
	}
82
}
83