Completed
Push — master ( ac9af8...b8b534 )
by Henry
07:38
created

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

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

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->init();
33
		$installer->rawCreate();
34
		$installer->insertSettings($optionArray);
35
	}
36
37
	/**
38
	 * tearDown
39
	 *
40
	 * @since 4.0.0
41
	 */
42
43
	public function tearDown() : void
44
	{
45
		$this->dropDatabase();
0 ignored issues
show
The method dropDatabase() does not seem to exist on object<Redaxscript\Tests\View\Helper\BylineTest>.

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...
46
	}
47
48
	/**
49
	 * testRender
50
	 *
51
	 * @since 4.0.0
52
	 *
53
	 * @param int $date
54
	 * @param string $author
55
	 * @param array $optionArray
56
	 * @param string $expect
57
	 *
58
	 * @dataProvider providerAutoloader
59
	 */
60
61
	public function testRender(int $date = null, string $author = null,  array $optionArray = [], string $expect = null) : void
62
	{
63
		/* setup */
64
65
		$byline = new Byline($this->_registry, $this->_language);
66
		$byline->init($optionArray);
67
68
		/* actual */
69
70
		$actual = $byline->render($date, $author);
71
72
		/* compare */
73
74
		$this->assertEquals($expect, $actual);
75
	}
76
}
77