Completed
Push — master ( b362d7...ee34ad )
by mw
7s
created

PropertyRegistryTest::newSmwPropertyRegistry()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 4
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 testRegistry() {
20
		$instance = new PropertyRegistry();
21
		$instance->register( $this->newSmwPropertyRegistry() );
22
23
		$this->assertSame(
24
			SMW_NOTIFICATIONS_ON,
25
			DIProperty::findPropertyLabel( PropertyRegistry::NOTIFICATIONS_ON )
0 ignored issues
show
Deprecated Code introduced by
The method SMW\DIProperty::findPropertyLabel() has been deprecated with message: since 2.1, use PropertyRegistry::findPropertyLabelById

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
26
		);
27
28
		$this->assertSame(
29
			SMW_NOTIFICATIONS_TO_GROUP,
30
			DIProperty::findPropertyLabel( PropertyRegistry::NOTIFICATIONS_TO_GROUP )
0 ignored issues
show
Deprecated Code introduced by
The method SMW\DIProperty::findPropertyLabel() has been deprecated with message: since 2.1, use PropertyRegistry::findPropertyLabelById

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
31
		);
32
33
		$this->assertSame(
34
			SMW_NOTIFICATIONS_GROUP_MEMBER_OF,
35
			DIProperty::findPropertyLabel( PropertyRegistry::NOTIFICATIONS_GROUP_MEMBER_OF )
0 ignored issues
show
Deprecated Code introduced by
The method SMW\DIProperty::findPropertyLabel() has been deprecated with message: since 2.1, use PropertyRegistry::findPropertyLabelById

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
36
		);
37
38
		$this->assertSame(
39
			SMW_NOTIFICATIONS_TO,
40
			DIProperty::findPropertyLabel( PropertyRegistry::NOTIFICATIONS_TO )
0 ignored issues
show
Deprecated Code introduced by
The method SMW\DIProperty::findPropertyLabel() has been deprecated with message: since 2.1, use PropertyRegistry::findPropertyLabelById

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
41
		);
42
	}
43
44
	private function newSmwPropertyRegistry() {
45
		return $this->getMockBuilder( \SMW\PropertyRegistry::class )
46
			->disableOriginalConstructor()
47
			->getMock();
48
	}
49
50
}
51