Passed
Pull Request — master (#21)
by GIT
08:43 queued 44s
created

PropertyRegistryTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 44
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SMW\ApprovedRevs\Tests;
4
5
use SMW\ApprovedRevs\PropertyRegistry;
6
7
/**
8
 * @covers \SMW\ApprovedRevs\PropertyRegistry
9
 * @group semantic-approved-revs
10
 *
11
 * @license GNU GPL v2+
12
 * @since 1.0
13
 *
14
 * @author mwjames
15
 */
16
class PropertyRegistryTest extends \PHPUnit_Framework_TestCase {
17
18
	private $propertyRegistry;
19
20
	protected function setUp(): void {
21
22
		$this->propertyRegistry = $this->getMockBuilder( '\SMW\PropertyRegistry' )
23
			->disableOriginalConstructor()
24
			->getMock();
25
	}
26
27
	public function testCanConstruct() {
28
29
		$this->assertInstanceOf(
30
			PropertyRegistry::class,
31
			new PropertyRegistry()
32
		);
33
	}
34
35
	public function testRegister( ) {
36
37
		$this->propertyRegistry->expects( $this->exactly( 4 ) )
38
			->method( 'registerProperty' )
39
			->withConsecutive(
40
				[ $this->equalTo('__sar_approved_rev') ],
41
				[ $this->equalTo('__sar_approved_by') ],
42
				[ $this->equalTo('__sar_approved_date') ],
43
				[ $this->equalTo('__sar_approved_status') ] );
44
45
		$this->propertyRegistry->expects( $this->exactly( 4 ) )
46
			->method( 'registerPropertyAlias' );
47
48
		$this->propertyRegistry->expects( $this->exactly( 4 ) )
49
			->method( 'registerPropertyAliasByMsgKey' );
50
51
		$this->propertyRegistry->expects( $this->exactly( 4 ) )
52
			->method( 'registerPropertyDescriptionMsgKeyById' );
53
54
		$instance = new PropertyRegistry();
55
56
		$instance->register( $this->propertyRegistry );
57
	}
58
59
}
60