Completed
Push — master ( b847fc...ad9166 )
by mw
03:15
created

PropertyRegistryTest::testRegister()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
cc 1
nc 1
nop 0
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->any() )
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