PropertyRegistryTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 59
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanConstruct() 0 7 1
A testILLRegister() 0 23 1
A testIWLRegister() 0 23 1
1
<?php
2
3
namespace SIL\Tests;
4
5
use SIL\PropertyRegistry;
6
use SMW\PropertyRegistry as SemanticMediaWikiPropertyRegistry;
7
use SMW\DIProperty;
8
9
/**
10
 * @covers \SIL\PropertyRegistry
11
 *
12
 * @group semantic-interlanguage-links
13
 *
14
 * @license GNU GPL v2+
15
 * @since 1.0
16
 *
17
 * @author mwjames
18
 */
19
class PropertyRegistryTest extends \PHPUnit_Framework_TestCase {
20
21
	public function testCanConstruct() {
22
23
		$this->assertInstanceOf(
24
			PropertyRegistry::class,
25
			new PropertyRegistry()
26
		);
27
	}
28
29
	public function testILLRegister() {
30
31
		$semanticMediaWikiPropertyRegistry = SemanticMediaWikiPropertyRegistry::getInstance();
32
33
		$propertyRegistry = $this->getMockBuilder( '\SMW\PropertyRegistry' )
34
			->disableOriginalConstructor()
35
			->getMock();
36
37
		$instance = new PropertyRegistry();
38
		$instance->register( $propertyRegistry );
39
40
		$this->assertNotEmpty(
41
			$semanticMediaWikiPropertyRegistry->findPropertyLabel( PropertyRegistry::SIL_ILL_LANG )
0 ignored issues
show
Deprecated Code introduced by
The method SMW\PropertyRegistry::findPropertyLabel() has been deprecated with message: since 2.1 use findPropertyLabelById instead

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...
42
		);
43
44
		$this->assertNotEmpty(
45
			$semanticMediaWikiPropertyRegistry->findPropertyLabel( PropertyRegistry::SIL_ILL_REF )
0 ignored issues
show
Deprecated Code introduced by
The method SMW\PropertyRegistry::findPropertyLabel() has been deprecated with message: since 2.1 use findPropertyLabelById instead

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...
46
		);
47
48
		$this->assertNotEmpty(
49
			$semanticMediaWikiPropertyRegistry->findPropertyLabel( PropertyRegistry::SIL_CONTAINER )
0 ignored issues
show
Deprecated Code introduced by
The method SMW\PropertyRegistry::findPropertyLabel() has been deprecated with message: since 2.1 use findPropertyLabelById instead

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...
50
		);
51
	}
52
53
	public function testIWLRegister() {
54
55
		$semanticMediaWikiPropertyRegistry = SemanticMediaWikiPropertyRegistry::getInstance();
56
57
		$propertyRegistry = $this->getMockBuilder( '\SMW\PropertyRegistry' )
58
			->disableOriginalConstructor()
59
			->getMock();
60
61
		$instance = new PropertyRegistry();
62
		$instance->register( $propertyRegistry );
63
64
		$this->assertNotEmpty(
65
			$semanticMediaWikiPropertyRegistry->findPropertyLabel( PropertyRegistry::SIL_IWL_LANG )
0 ignored issues
show
Deprecated Code introduced by
The method SMW\PropertyRegistry::findPropertyLabel() has been deprecated with message: since 2.1 use findPropertyLabelById instead

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...
66
		);
67
68
		$this->assertNotEmpty(
69
			$semanticMediaWikiPropertyRegistry->findPropertyLabel( PropertyRegistry::SIL_IWL_REF )
0 ignored issues
show
Deprecated Code introduced by
The method SMW\PropertyRegistry::findPropertyLabel() has been deprecated with message: since 2.1 use findPropertyLabelById instead

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...
70
		);
71
72
		$this->assertNotEmpty(
73
			$semanticMediaWikiPropertyRegistry->findPropertyLabel( PropertyRegistry::SIL_CONTAINER )
0 ignored issues
show
Deprecated Code introduced by
The method SMW\PropertyRegistry::findPropertyLabel() has been deprecated with message: since 2.1 use findPropertyLabelById instead

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...
74
		);
75
	}
76
77
}
78