Completed
Push — master ( 1da492...320203 )
by Henry
07:00
created

tests/unit/View/LoginFormTest.php (4 issues)

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
 * LoginFormTest
9
 *
10
 * @since 3.0.0
11
 *
12
 * @package Redaxscript
13
 * @category Tests
14
 * @author Henry Ruhs
15
 *
16
 * @covers Redaxscript\View\LoginForm
17
 * @covers Redaxscript\View\ViewAbstract
18
 */
19
20
class LoginFormTest 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 = $this->getOptionArray();
0 ignored issues
show
The method getOptionArray() does not seem to exist on object<Redaxscript\Tests\View\LoginFormTest>.

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...
32
		$installer = $this->installerFactory();
0 ignored issues
show
The method installerFactory() does not seem to exist on object<Redaxscript\Tests\View\LoginFormTest>.

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...
33
		$installer->init();
34
		$installer->rawCreate();
35
		$installer->insertSettings($optionArray);
36
		$setting = $this->settingFactory();
0 ignored issues
show
The method settingFactory() does not seem to exist on object<Redaxscript\Tests\View\LoginFormTest>.

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

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