HookRegistryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCanConstruct() 0 11 1
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