public function testFindPropertyLabelForRegisteredId() { $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())); $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass(); $propertyLabelFinder = new PropertyLabelFinder($store, array()); $propertyAliases = array(); $instance = new PropertyRegistry($datatypeRegistry, $propertyLabelFinder, $propertyAliases); $instance->registerProperty(DIProperty::TYPE_HAS_TYPE, '__typ', 'Has type', true); $this->assertEquals('Has type', $instance->findPropertyLabelById('_TYPE')); // findPropertyLabel legacy test $this->assertEquals('Has type', $instance->findPropertyLabel('_TYPE')); // This was part of an extra test but the extra test caused an segfault on postgres travis-ci $this->assertEquals('__typ', $instance->getPropertyTypeId('_TYPE')); // getPredefinedPropertyTypeId legacy test $this->assertEquals('__typ', $instance->getPredefinedPropertyTypeId('_TYPE')); }