PropertyRegistryTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanConstruct() 0 7 1
A testRegister() 0 18 1
1
<?php
2
3
namespace SMW\Notifications\Tests;
4
5
use SMW\Notifications\PropertyRegistry;
6
use SMW\DIProperty;
7
8
/**
9
 * @covers \SMW\Notifications\PropertyRegistry
10
 * @group semantic-notifications
11
 *
12
 * @license GNU GPL v2+
13
 * @since 1.0
14
 *
15
 * @author mwjames
16
 */
17
class PropertyRegistryTest extends \PHPUnit_Framework_TestCase {
18
19
	public function testCanConstruct() {
20
21
		$this->assertInstanceOf(
22
			PropertyRegistry::class,
23
			new PropertyRegistry()
24
		);
25
	}
26
27
	public function testRegister() {
28
29
		$propertyRegistry = $this->getMockBuilder( '\SMW\PropertyRegistry' )
30
			->disableOriginalConstructor()
31
			->getMock();
32
33
		$propertyRegistry->expects( $this->atLeastOnce() )
34
			->method( 'registerProperty' )
35
			->withConsecutive(
36
				[ $this->equalTo( PropertyRegistry::NOTIFICATIONS_ON ) ],
37
				[ $this->equalTo( PropertyRegistry::NOTIFICATIONS_TO_GROUP ) ],
38
				[ $this->equalTo( PropertyRegistry::NOTIFICATIONS_GROUP_MEMBER_OF ) ],
39
				[ $this->equalTo( PropertyRegistry::NOTIFICATIONS_TO ) ]
40
			);
41
42
		$instance = new PropertyRegistry();
43
		$instance->registerTo( $propertyRegistry );
44
	}
45
46
}
47