Lucas Werkmeister (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/392040 )
Change subject: Don’t use JsonFileEntityLookup in RangeCheckerTest ...................................................................... Don’t use JsonFileEntityLookup in RangeCheckerTest Bug: T168240 Change-Id: Idf6ce5a1ac4d11638d7d37d583977c261f6dcbcf --- D tests/phpunit/Checker/RangeChecker/P1.json D tests/phpunit/Checker/RangeChecker/P2.json M tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php 3 files changed, 5 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints refs/changes/40/392040/1 diff --git a/tests/phpunit/Checker/RangeChecker/P1.json b/tests/phpunit/Checker/RangeChecker/P1.json deleted file mode 100644 index c5c32ad..0000000 --- a/tests/phpunit/Checker/RangeChecker/P1.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "P1", - "type": "property", - "datatype": "time" -} diff --git a/tests/phpunit/Checker/RangeChecker/P2.json b/tests/phpunit/Checker/RangeChecker/P2.json deleted file mode 100644 index 13ce8a6..0000000 --- a/tests/phpunit/Checker/RangeChecker/P2.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "P1", - "type": "property", - "datatype": "quantity" -} diff --git a/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php b/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php index 46ffc63..df3cf8b 100644 --- a/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php +++ b/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php @@ -3,7 +3,7 @@ namespace WikibaseQuality\ConstraintReport\Test\RangeChecker; use Wikibase\DataModel\Entity\EntityDocument; -use Wikibase\DataModel\Services\Lookup\EntityRetrievingDataTypeLookup; +use Wikibase\DataModel\Services\Lookup\InMemoryDataTypeLookup; use Wikibase\DataModel\Snak\PropertyValueSnak; use DataValues\DecimalValue; use DataValues\QuantityValue; @@ -24,7 +24,6 @@ use WikibaseQuality\ConstraintReport\Tests\ConstraintParameters; use WikibaseQuality\ConstraintReport\Tests\Fake\FakeSnakContext; use WikibaseQuality\ConstraintReport\Tests\ResultAssertions; -use WikibaseQuality\Tests\Helper\JsonFileEntityLookup; /** * @covers \WikibaseQuality\ConstraintReport\ConstraintCheck\Checker\RangeChecker @@ -42,11 +41,6 @@ use ConstraintParameters, ResultAssertions; /** - * @var JsonFileEntityLookup - */ - private $lookup; - - /** * @var TimeValue */ private $timeValue; @@ -58,14 +52,16 @@ protected function setUp() { parent::setUp(); - $this->lookup = new JsonFileEntityLookup( __DIR__ ); $this->timeValue = new TimeValue( '+00000001970-01-01T00:00:00Z', 0, 0, 0, 11, 'http://www.wikidata.org/entity/Q1985727' ); $rangeCheckerHelper = new RangeCheckerHelper( $this->getDefaultConfig(), new UnitConverter( new CSVUnitStorage( __DIR__ . '/units.csv' ), '' ) ); + $dataTypeLookup = new InMemoryDataTypeLookup(); + $dataTypeLookup->setDataTypeForProperty( new PropertyId( 'P1' ), 'time' ); + $dataTypeLookup->setDataTypeForProperty( new PropertyId( 'P2' ), 'quantity' ); $this->checker = new RangeChecker( - new EntityRetrievingDataTypeLookup( $this->lookup ), + $dataTypeLookup, $this->getConstraintParameterParser(), $rangeCheckerHelper, $this->getConstraintParameterRenderer() -- To view, visit https://gerrit.wikimedia.org/r/392040 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf6ce5a1ac4d11638d7d37d583977c261f6dcbcf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE) <lucas.werkmeis...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits