Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function testIndexCreatesChecker() |
||
26 | { |
||
27 | $controller = new DevHealthController(); |
||
28 | |||
29 | $request = new HTTPRequest('GET', 'example.com'); |
||
30 | |||
31 | // we need to fake authenticated access as BasicAuth::requireLogin doesn't like empty |
||
32 | // permission type strings, which is what health check uses. |
||
33 | |||
34 | putenv('ENVCHECK_BASICAUTH_USERNAME="foo"'); |
||
35 | putenv('ENVCHECK_BASICAUTH_PASSWORD="bar"'); |
||
36 | |||
37 | $_SERVER['PHP_AUTH_USER'] = 'foo'; |
||
38 | $_SERVER['PHP_AUTH_PW'] = 'bar'; |
||
39 | |||
40 | $this->assertInstanceOf(EnvironmentChecker::class, $controller->index($request)); |
||
|
|||
41 | } |
||
43 |
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. Please note the @ignore annotation hint above.