mediawiki-extensions-Math/tests/phpunit/DummyPropertyDataTypeLookup.php
Umherirrender 0be18dc97d Move test helper classes into own class file
Also fix the name of one test file to match the file name

Change-Id: If622e925645cf21bf726f4db0f779182d78bbd73
2019-12-06 21:47:52 +01:00

25 lines
638 B
PHP

<?php
use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup;
class DummyPropertyDataTypeLookup implements PropertyDataTypeLookup {
/**
* @var int
*/
public static $mathId = 1;
/**
* Returns the data type for the Property of which the id is given.
*
* @since 2.0
*
* @param \Wikibase\DataModel\Entity\PropertyId $propertyId
*
* @return string
* @throws \Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookupException
*/
public function getDataTypeIdForProperty( \Wikibase\DataModel\Entity\PropertyId $propertyId ) {
return $propertyId->getNumericId() == self::$mathId ? 'math' : 'not-math';
}
}