public function testTypeIdAndLabelAsLanguageIndependantInvocation() { $extraneousLanguage = $this->getMockBuilder('\\SMW\\ExtraneousLanguage\\ExtraneousLanguage')->disableOriginalConstructor()->getMock(); $extraneousLanguage->expects($this->once())->method('getDatatypeLabels')->will($this->returnValue(array('_wpg' => 'Page'))); $extraneousLanguage->expects($this->once())->method('getDatatypeAliases')->will($this->returnValue(array('URI' => '_uri'))); $extraneousLanguage->expects($this->once())->method('getCanonicalDatatypeLabels')->will($this->returnValue(array())); $instance = new DataTypeRegistry($extraneousLanguage); $this->assertEquals('_wpg', $instance->findTypeId('Page'), 'Asserts that findTypeID returns empty label'); $this->assertEquals(array('_wpg' => 'Page'), $instance->getKnownTypeLabels(), 'Asserts that getKnownTypeLabels returns an array'); }
public function testTypeIdAndLabelAsLanguageIndependantInvocation() { $instance = new DataTypeRegistry(array('_wpg' => 'Page'), array('URI' => '_uri')); $this->assertEquals('_wpg', $instance->findTypeId('Page'), 'Asserts that findTypeID returns empty label'); $this->assertEquals(array('_wpg' => 'Page'), $instance->getKnownTypeLabels(), 'Asserts that getKnownTypeLabels returns an array'); }