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\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
|
|||
38 | |||
39 | /* actual */ |
||
40 | |||
41 | $actual = $title->render($text); |
||
42 | |||
43 | /* compare */ |
||
44 | |||
45 | $this->assertEquals($expect, $actual); |
||
46 | } |
||
47 | } |
||
48 |
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.