public function testRegisterProperty() { $datatypeRegistry = $this->getMockBuilder('\\SMW\\DataTypeRegistry')->disableOriginalConstructor()->getMock(); $datatypeRegistry->expects($this->once())->method('getKnownTypeLabels')->will($this->returnValue(array())); $datatypeRegistry->expects($this->once())->method('getKnownTypeAliases')->will($this->returnValue(array())); $propertyLabels = array(); $propertyAliases = array(); $instance = new PropertyRegistry($datatypeRegistry, $propertyLabels, $propertyAliases); $instance->registerProperty(DIProperty::TYPE_HAS_TYPE, '__typ', 'Has type', true); $this->assertEquals(array('_TYPE' => 'Has type'), $instance->getKnownPropertyLabels()); $this->assertEquals(array('_TYPE' => array('__typ', true)), $instance->getKnownPropertyTypes()); $this->assertTrue($instance->getPropertyVisibility('_TYPE')); $this->assertTrue($instance->isKnownPropertyId('_TYPE')); $this->assertFalse($instance->getPropertyVisibility('_UnregisteredType')); $this->assertFalse($instance->isKnownPropertyId('_UnregisteredType')); }