HookRegistryTest::testCanConstruct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
1
<?php
2
3
namespace SG\Tests;
4
5
use SG\HookRegistry;
6
use SMW\DIProperty;
7
8
/**
9
 * @covers \SG\HookRegistry
10
 * @group semantic-glossary
11
 *
12
 * @license GNU GPL v2+
13
 * @since 1.2
14
 *
15
 * @author mwjames
16
 */
17
class HookRegistryTest extends \PHPUnit_Framework_TestCase {
18
19
	public function testCanConstruct() {
20
21
		$store = $this->getMockBuilder( '\SMW\Store' )
22
			->disableOriginalConstructor()
23
			->getMockForAbstractClass();
24
25
		$this->assertInstanceOf(
26
			'\SG\HookRegistry',
27
			new HookRegistry( $store )
0 ignored issues
show
Unused Code introduced by
The call to HookRegistry::__construct() has too many arguments starting with $store.

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...
28
		);
29
	}
30
31
}
32