TitleTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 28
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRender() 0 14 1
1
<?php
2
namespace Redaxscript\Tests\Head;
3
4
use Redaxscript\Head;
5
use Redaxscript\Tests\TestCaseAbstract;
6
7
/**
8
 * TitleTest
9
 *
10
 * @since 3.0.0
11
 *
12
 * @package Redaxscript
13
 * @category Tests
14
 * @author Balázs Szilágyi
15
 *
16
 * @covers Redaxscript\Head\HeadAbstract
17
 * @covers Redaxscript\Head\Title
18
 */
19
20
class TitleTest extends TestCaseAbstract
21
{
22
	/**
23
	 * testRender
24
	 *
25
	 * @since 3.0.0
26
	 *
27
	 * @param string $text
28
	 * @param string $expect
29
	 *
30
	 * @dataProvider providerAutoloader
31
	 */
32
33
	public function testRender(string $text= null, string $expect = null) : void
34
	{
35
		/* setup */
36
37
		$title = new Head\Title($this->_registry);
0 ignored issues
show
Unused Code introduced by
The call to Title::__construct() has too many arguments starting with $this->_registry.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
38
39
		/* actual */
40
41
		$actual = $title->render($text);
42
43
		/* compare */
44
45
		$this->assertEquals($expect, $actual);
46
	}
47
}
48