1 | <?php |
||
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 |