Completed
Branch master (48c558)
by
unknown
05:41
created

MetaTest::testInvalid()   A

↳ Parent: MetaTest

Complexity

Conditions 1
Paths 1

Duplication

Lines 0
Ratio 0 %

Size

Total Lines 15
Code Lines 5

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
namespace Redaxscript\Tests\Head;
3
4
use Redaxscript\Head;
5
use Redaxscript\Tests\TestCaseAbstract;
6
7
/**
8
 * MetaTest
9
 *
10
 * @since 3.0.0
11
 *
12
 * @package Redaxscript
13
 * @category Tests
14
 * @author Henry Ruhs
15
 * @author Balázs Szilágyi
16
 */
17
18
class MetaTest extends TestCaseAbstract
19
{
20
	/**
21
	 * providerAppend
22
	 *
23
	 * @since 3.0.0
24
	 *
25
	 * @return array
26
	 */
27
28
	public function providerAppend()
29
	{
30
		return $this->getProvider('tests/provider/Head/meta_append.json');
31
	}
32
33
	/**
34
	 * testAppend
35
	 *
36
	 * @since 3.0.0
37
	 *
38
	 * @param array $metaArray
39
	 * @param string $expect
40
	 *
41
	 * @dataProvider providerAppend
42
	 */
43
44
	public function testAppend($metaArray = [], $expect = null)
45
	{
46
		/* setup */
47
48
		$meta = Head\Meta::getInstance();
49
		$meta->init('append');
50
		foreach ($metaArray as $value)
51
		{
52
			$meta->append($value);
53
		}
54
55
		/* actual */
56
57
		$actual = $meta;
58
59
		/* compare */
60
61
		$this->assertEquals($this->normalizeEOL($expect), $actual);
62
	}
63
64
	/**
65
	 * testInvalid
66
	 *
67
	 * @since 3.0.0
68
	 *
69
	 */
70
71
	public function testInvalid()
72
	{
73
		/* setup */
74
75
		$meta = Head\Meta::getInstance();
76
		$meta->init('invalid');
77
78
		/* expect and actual */
79
80
		$actual = (string)$meta;
81
82
		/* compare */
83
84
		$this->assertEquals('<!-- Redaxscript\Head\Meta\Invalid -->', $actual);
85
	}
86
}
87