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

tests/unit/Admin/View/ExtraTableTest.php (2 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\Admin\View;
3
4
use Redaxscript\Admin;
5
use Redaxscript\Db;
6
use Redaxscript\Tests\TestCaseAbstract;
7
8
/**
9
 * ExtraTableTest
10
 *
11
 * @since 4.0.0
12
 *
13
 * @package Redaxscript
14
 * @category Tests
15
 * @author Henry Ruhs
16
 *
17
 * @covers Redaxscript\Admin\View\ExtraTable
18
 * @covers Redaxscript\Admin\View\ViewAbstract
19
 */
20
21
class ExtraTableTest extends TestCaseAbstract
22
{
23
	/**
24
	 * setUp
25
	 *
26
	 * @since 4.0.0
27
	 */
28
29
	public function setUp() : void
30
	{
31
		parent::setUp();
32
		$installer = $this->installerFactory();
0 ignored issues
show
The method installerFactory() does not seem to exist on object<Redaxscript\Tests...in\View\ExtraTableTest>.

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
		Db::forTablePrefix('extras')
36
			->create()
37
			->set(
38
			[
39
				'title' => 'Extra One',
40
				'alias' => 'extra-one',
41
			])
42
			->save();
43
	}
44
45
	/**
46
	 * tearDown
47
	 *
48
	 * @since 4.0.0
49
	 */
50
51
	public function tearDown() : void
52
	{
53
		$this->dropDatabase();
0 ignored issues
show
The method dropDatabase() does not seem to exist on object<Redaxscript\Tests...in\View\ExtraTableTest>.

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