Addshore has uploaded a new change for review. https://gerrit.wikimedia.org/r/230758
Change subject: Use moved Lookups in DataModelServices ...................................................................... Use moved Lookups in DataModelServices Change-Id: I8e27eacd5d421b2093bf42f1a1c1e60de9401b8b --- M client/includes/DataAccess/PropertyIdResolver.php M client/includes/DataAccess/PropertyParserFunction/PropertyClaimsRendererFactory.php M client/includes/DataAccess/RestrictedEntityLookup.php M client/includes/DataAccess/Scribunto/EntityAccessor.php M client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php M client/includes/DataAccess/Scribunto/WikibaseLuaBindings.php M client/includes/DataAccess/StatementTransclusionInteractor.php M client/includes/Hooks/LanguageLinkBadgeDisplay.php M client/includes/LangLinkHandler.php M client/includes/Usage/UsageTrackingTermLookup.php M client/includes/WikibaseClient.php M client/includes/store/ClientStore.php M client/includes/store/sql/DirectSqlStore.php M client/tests/phpunit/includes/DataAccess/PropertyParserFunction/LanguageAwareRendererTest.php M client/tests/phpunit/includes/DataAccess/PropertyParserFunction/PropertyClaimsRendererFactoryTest.php M client/tests/phpunit/includes/DataAccess/PropertyParserFunction/RunnerTest.php M client/tests/phpunit/includes/DataAccess/RestrictedEntityLookupTest.php M client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php M client/tests/phpunit/includes/DataAccess/Scribunto/WikibaseLuaBindingsTest.php M client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php M client/tests/phpunit/includes/Hooks/SidebarHookHandlersTest.php M client/tests/phpunit/includes/Usage/UsageTrackingTermLookupTest.php M client/tests/phpunit/includes/store/sql/DirectSqlStoreTest.php D lib/includes/EntityRetrievingDataTypeLookup.php M lib/includes/formatters/EntityIdHtmlLinkFormatter.php M lib/includes/formatters/EntityIdLabelFormatter.php M lib/includes/formatters/EntityLabelUnitFormatter.php M lib/includes/formatters/FormatterLabelDescriptionLookupFactory.php M lib/includes/store/EntityInfoTermLookup.php D lib/includes/store/EntityLookup.php D lib/includes/store/EntityRedirectLookup.php D lib/includes/store/EntityRetrievingTermLookup.php M lib/includes/store/EntityTermLookupBase.php D lib/includes/store/LabelDescriptionLookup.php M lib/includes/store/LanguageFallbackLabelDescriptionLookup.php D lib/includes/store/LanguageLabelDescriptionLookup.php M lib/includes/store/RedirectResolvingEntityLookup.php M lib/includes/store/RevisionBasedEntityLookup.php D lib/includes/store/TermLookup.php D lib/tests/phpunit/EntityRetrievingDataTypeLookupTest.php M lib/tests/phpunit/MockRepository.php M lib/tests/phpunit/PropertyInfoDataTypeLookupTest.php M lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php M lib/tests/phpunit/formatters/EntityIdLabelFormatterTest.php M lib/tests/phpunit/formatters/EntityLabelUnitFormatterTest.php M lib/tests/phpunit/formatters/FormatterLabelDescriptionLookupFactoryTest.php M lib/tests/phpunit/formatters/WikibaseSnakFormatterBuildersTest.php M lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php M lib/tests/phpunit/store/CachingEntityRevisionLookupTest.php D lib/tests/phpunit/store/EntityRetrievingTermLookupTest.php D lib/tests/phpunit/store/LanguageLabelDescriptionLookupTest.php M lib/tests/phpunit/store/RedirectResolvingEntityLookupTest.php M repo/includes/Diff/EntityContentDiffView.php M repo/includes/Dumpers/JsonDumpGenerator.php M repo/includes/EntityIdHtmlLinkFormatterFactory.php M repo/includes/EntityIdLabelFormatterFactory.php M repo/includes/Hooks/LinkBeginHookHandler.php M repo/includes/Interactors/RedirectCreationInteractor.php M repo/includes/LanguageFallbackLabelDescriptionLookupFactory.php M repo/includes/LinkedData/EntityDataRequestHandler.php M repo/includes/LinkedData/EntityDataSerializationService.php M repo/includes/ValidatorBuilders.php M repo/includes/Validators/EntityExistsValidator.php M repo/includes/WikibaseHtmlSnakFormatterFactory.php M repo/includes/WikibaseRepo.php M repo/includes/actions/EditEntityAction.php M repo/includes/api/SearchEntities.php M repo/includes/rdf/RdfBuilder.php M repo/includes/specials/SpecialGoToLinkedPage.php M repo/includes/store/Store.php M repo/includes/store/sql/ItemsPerSiteBuilder.php M repo/includes/store/sql/PropertyInfoTableBuilder.php M repo/includes/store/sql/SqlStore.php M repo/includes/store/sql/WikiPageEntityRedirectLookup.php M repo/maintenance/dumpJson.php M repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php M repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php M repo/tests/phpunit/includes/EntityIdHtmlLinkFormatterFactoryTest.php M repo/tests/phpunit/includes/EntityIdLabelFormatterFactoryTest.php M repo/tests/phpunit/includes/Hooks/LinkBeginHookHandlerTest.php M repo/tests/phpunit/includes/LanguageFallbackLabelDescriptionLookupFactoryTest.php M repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php M repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php M repo/tests/phpunit/includes/WikibaseHtmlSnakFormatterFactoryTest.php M repo/tests/phpunit/includes/WikibaseRepoTest.php M repo/tests/phpunit/includes/api/SearchEntitiesTest.php M repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php M repo/tests/phpunit/includes/specials/SpecialListPropertiesTest.php M repo/tests/phpunit/includes/store/WikiPageEntityRevisionLookupTest.php M repo/tests/phpunit/includes/store/sql/ItemsPerSiteBuilderTest.php M view/src/EntityIdFormatterFactory.php M view/src/EntityViewFactory.php M view/src/HtmlSnakFormatterFactory.php M view/tests/phpunit/EntityViewFactoryTest.php 94 files changed, 121 insertions(+), 920 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/58/230758/1 diff --git a/client/includes/DataAccess/PropertyIdResolver.php b/client/includes/DataAccess/PropertyIdResolver.php index ba45e58..2fab4a0 100644 --- a/client/includes/DataAccess/PropertyIdResolver.php +++ b/client/includes/DataAccess/PropertyIdResolver.php @@ -5,7 +5,7 @@ use InvalidArgumentException; use Wikibase\DataModel\Entity\PropertyId; use Wikibase\Client\PropertyLabelNotResolvedException; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\PropertyLabelResolver; /** diff --git a/client/includes/DataAccess/PropertyParserFunction/PropertyClaimsRendererFactory.php b/client/includes/DataAccess/PropertyParserFunction/PropertyClaimsRendererFactory.php index d7ad151..a6a3591 100644 --- a/client/includes/DataAccess/PropertyParserFunction/PropertyClaimsRendererFactory.php +++ b/client/includes/DataAccess/PropertyParserFunction/PropertyClaimsRendererFactory.php @@ -17,7 +17,7 @@ use Wikibase\Lib\FormatterLabelDescriptionLookupFactory; use Wikibase\Lib\OutputFormatSnakFormatterFactory; use Wikibase\Lib\SnakFormatter; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; /** * @since 0.5 diff --git a/client/includes/DataAccess/RestrictedEntityLookup.php b/client/includes/DataAccess/RestrictedEntityLookup.php index 1de2e85..1f20689 100644 --- a/client/includes/DataAccess/RestrictedEntityLookup.php +++ b/client/includes/DataAccess/RestrictedEntityLookup.php @@ -4,7 +4,7 @@ use Wikimedia\Assert\Assert; use Wikibase\DataModel\Entity\EntityId; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; /** * EntityLookup that counts how many entities have been loaded through it and throws diff --git a/client/includes/DataAccess/Scribunto/EntityAccessor.php b/client/includes/DataAccess/Scribunto/EntityAccessor.php index ba02c85..26a176e 100644 --- a/client/includes/DataAccess/Scribunto/EntityAccessor.php +++ b/client/includes/DataAccess/Scribunto/EntityAccessor.php @@ -9,7 +9,7 @@ use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup; use Wikibase\LanguageFallbackChain; use Wikibase\Lib\ContentLanguages; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\UnresolvedRedirectException; /** diff --git a/client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php b/client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php index 8b362b5..914b33c 100644 --- a/client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php +++ b/client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php @@ -17,7 +17,7 @@ use Wikibase\LanguageFallbackChainFactory; use Wikibase\Client\PropertyLabelNotResolvedException; use Wikibase\Lib\SnakFormatter; -use Wikibase\Lib\Store\EntityRetrievingTermLookup; +use Wikibase\DataModel\Services\Lookup\EntityRetrievingTermLookup; use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookup; /** diff --git a/client/includes/DataAccess/Scribunto/WikibaseLuaBindings.php b/client/includes/DataAccess/Scribunto/WikibaseLuaBindings.php index 3ace252..fad00b7 100644 --- a/client/includes/DataAccess/Scribunto/WikibaseLuaBindings.php +++ b/client/includes/DataAccess/Scribunto/WikibaseLuaBindings.php @@ -10,8 +10,8 @@ use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Services\EntityId\EntityIdParser; use Wikibase\DataModel\Services\EntityId\EntityIdParsingException; -use Wikibase\Lib\Store\EntityLookup; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; use Wikibase\Lib\Store\SiteLinkLookup; use Wikibase\Lib\Store\StorageException; use Wikibase\SettingsArray; diff --git a/client/includes/DataAccess/StatementTransclusionInteractor.php b/client/includes/DataAccess/StatementTransclusionInteractor.php index fd2027f..4c52b7c 100644 --- a/client/includes/DataAccess/StatementTransclusionInteractor.php +++ b/client/includes/DataAccess/StatementTransclusionInteractor.php @@ -8,7 +8,7 @@ use Wikibase\DataModel\Statement\StatementListProvider; use Wikibase\Client\PropertyLabelNotResolvedException; use Wikibase\Lib\SnakFormatter; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\UnresolvedRedirectException; /** diff --git a/client/includes/Hooks/LanguageLinkBadgeDisplay.php b/client/includes/Hooks/LanguageLinkBadgeDisplay.php index e4189e5..fbcf36b 100644 --- a/client/includes/Hooks/LanguageLinkBadgeDisplay.php +++ b/client/includes/Hooks/LanguageLinkBadgeDisplay.php @@ -9,7 +9,7 @@ use Title; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\SiteLink; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; /** * Provides access to the badges of the current page's sitelinks diff --git a/client/includes/LangLinkHandler.php b/client/includes/LangLinkHandler.php index 494e009..52f2aaf 100644 --- a/client/includes/LangLinkHandler.php +++ b/client/includes/LangLinkHandler.php @@ -10,7 +10,7 @@ use Wikibase\Client\ParserOutputDataUpdater; use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\SiteLink; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\SiteLinkLookup; /** diff --git a/client/includes/Usage/UsageTrackingTermLookup.php b/client/includes/Usage/UsageTrackingTermLookup.php index 7832f23..a42b4f1 100644 --- a/client/includes/Usage/UsageTrackingTermLookup.php +++ b/client/includes/Usage/UsageTrackingTermLookup.php @@ -4,7 +4,7 @@ use OutOfBoundsException; use Wikibase\DataModel\Entity\EntityId; -use Wikibase\Lib\Store\TermLookup; +use Wikibase\DataModel\Services\Lookup\TermLookup; /** * TermLookup decorator that records label usage in an TermLookup. diff --git a/client/includes/WikibaseClient.php b/client/includes/WikibaseClient.php index 1642c0e..178ab18 100644 --- a/client/includes/WikibaseClient.php +++ b/client/includes/WikibaseClient.php @@ -43,16 +43,16 @@ use Wikibase\LangLinkHandler; use Wikibase\LanguageFallbackChainFactory; use Wikibase\Lib\Changes\EntityChangeFactory; -use Wikibase\Lib\EntityRetrievingDataTypeLookup; +use Wikibase\DataModel\Services\Lookup\EntityRetrievingDataTypeLookup; use Wikibase\Lib\FormatterLabelDescriptionLookupFactory; use Wikibase\Lib\LanguageNameLookup; use Wikibase\Lib\OutputFormatSnakFormatterFactory; use Wikibase\Lib\OutputFormatValueFormatterFactory; use Wikibase\Lib\PropertyInfoDataTypeLookup; use Wikibase\Lib\Store\EntityContentDataCodec; -use Wikibase\Lib\Store\EntityLookup; -use Wikibase\Lib\Store\EntityRetrievingTermLookup; -use Wikibase\Lib\Store\TermLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityRetrievingTermLookup; +use Wikibase\DataModel\Services\Lookup\TermLookup; use Wikibase\Lib\WikibaseContentLanguages; use Wikibase\Lib\WikibaseDataTypeBuilders; use Wikibase\Lib\WikibaseSnakFormatterBuilders; diff --git a/client/includes/store/ClientStore.php b/client/includes/store/ClientStore.php index fbda221..2948382 100644 --- a/client/includes/store/ClientStore.php +++ b/client/includes/store/ClientStore.php @@ -8,7 +8,7 @@ use Wikibase\Client\Usage\UsageLookup; use Wikibase\Client\Usage\UsageTracker; use Wikibase\DataModel\Services\Entity\EntityPrefetcher; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\SiteLinkLookup; use Wikibase\Store\EntityIdLookup; diff --git a/client/includes/store/sql/DirectSqlStore.php b/client/includes/store/sql/DirectSqlStore.php index 836f4c6..9ca3127 100644 --- a/client/includes/store/sql/DirectSqlStore.php +++ b/client/includes/store/sql/DirectSqlStore.php @@ -21,7 +21,7 @@ use Wikibase\Lib\Store\CachingEntityRevisionLookup; use Wikibase\Lib\Store\CachingSiteLinkLookup; use Wikibase\Lib\Store\EntityContentDataCodec; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\RedirectResolvingEntityLookup; use Wikibase\Lib\Store\RevisionBasedEntityLookup; diff --git a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/LanguageAwareRendererTest.php b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/LanguageAwareRendererTest.php index a4ff84f..1157640 100644 --- a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/LanguageAwareRendererTest.php +++ b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/LanguageAwareRendererTest.php @@ -174,7 +174,7 @@ } private function getEntityLookup() { - $lookup = $this->getMock( 'Wikibase\Lib\Store\EntityLookup' ); + $lookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\EntityLookup' ); $lookup->expects( $this->any() ) ->method( 'getEntity' ) ->will( $this->returnValue( diff --git a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/PropertyClaimsRendererFactoryTest.php b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/PropertyClaimsRendererFactoryTest.php index f7499fb..546f67a 100644 --- a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/PropertyClaimsRendererFactoryTest.php +++ b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/PropertyClaimsRendererFactoryTest.php @@ -203,7 +203,7 @@ } private function getEntityLookup() { - $entityLookup = $this->getMockBuilder( 'Wikibase\Lib\Store\EntityLookup' ) + $entityLookup = $this->getMockBuilder( 'Wikibase\DataModel\Services\Lookup\EntityLookup' ) ->disableOriginalConstructor() ->getMock(); diff --git a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/RunnerTest.php b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/RunnerTest.php index d2f2c01..9882c23 100644 --- a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/RunnerTest.php +++ b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/RunnerTest.php @@ -161,7 +161,7 @@ */ private function getRestrictedEntityLookup() { return new RestrictedEntityLookup( - $this->getMock( 'Wikibase\Lib\Store\EntityLookup' ), + $this->getMock( 'Wikibase\DataModel\Services\Lookup\EntityLookup' ), 200 ); } diff --git a/client/tests/phpunit/includes/DataAccess/RestrictedEntityLookupTest.php b/client/tests/phpunit/includes/DataAccess/RestrictedEntityLookupTest.php index c71513e..4121933 100644 --- a/client/tests/phpunit/includes/DataAccess/RestrictedEntityLookupTest.php +++ b/client/tests/phpunit/includes/DataAccess/RestrictedEntityLookupTest.php @@ -19,7 +19,7 @@ class RestrictedEntityLookupTest extends \PHPUnit_Framework_TestCase { private function getEntityLookup() { - $entityLookup = $this->getMock( 'Wikibase\Lib\Store\EntityLookup' ); + $entityLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\EntityLookup' ); $entityLookup->expects( $this->any() ) ->method( 'hasEntity' ) diff --git a/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php b/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php index fa852bb..719b480 100644 --- a/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php +++ b/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php @@ -18,7 +18,7 @@ use Wikibase\DataModel\Snak\PropertyValueSnak; use Wikibase\DataModel\Snak\SnakList; use Wikibase\LanguageFallbackChainFactory; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Test\MockRepository; /** diff --git a/client/tests/phpunit/includes/DataAccess/Scribunto/WikibaseLuaBindingsTest.php b/client/tests/phpunit/includes/DataAccess/Scribunto/WikibaseLuaBindingsTest.php index 9ddba83..828337a 100644 --- a/client/tests/phpunit/includes/DataAccess/Scribunto/WikibaseLuaBindingsTest.php +++ b/client/tests/phpunit/includes/DataAccess/Scribunto/WikibaseLuaBindingsTest.php @@ -13,7 +13,7 @@ use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Services\EntityId\BasicEntityIdParser; use Wikibase\DataModel\Term\Term; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\SettingsArray; use Wikibase\Test\MockRepository; @@ -62,7 +62,7 @@ return $page === 'Rome' ? new ItemId( 'Q33' ) : false; } ) ); - $labelDescriptionLookup = $this->getMock( 'Wikibase\Lib\Store\LabelDescriptionLookup' ); + $labelDescriptionLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup' ); $labelDescriptionLookup->expects( $this->any() ) ->method( 'getLabel' ) ->will( $this->returnValue( new Term( 'xy', 'LabelString' ) ) ); diff --git a/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php b/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php index 0f35483..343148a 100644 --- a/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php +++ b/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php @@ -161,7 +161,7 @@ } private function getEntityLookup() { - $lookup = $this->getMock( 'Wikibase\Lib\Store\EntityLookup' ); + $lookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\EntityLookup' ); $lookup->expects( $this->any() ) ->method( 'getEntity' ) ->will( $this->returnValue( diff --git a/client/tests/phpunit/includes/Hooks/SidebarHookHandlersTest.php b/client/tests/phpunit/includes/Hooks/SidebarHookHandlersTest.php index 609a97a..ea04948 100644 --- a/client/tests/phpunit/includes/Hooks/SidebarHookHandlersTest.php +++ b/client/tests/phpunit/includes/Hooks/SidebarHookHandlersTest.php @@ -18,7 +18,7 @@ use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\SiteLink; use Wikibase\DataModel\SiteLinkList; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\NamespaceChecker; use Wikibase\SettingsArray; use Wikibase\Test\MockRepository; diff --git a/client/tests/phpunit/includes/Usage/UsageTrackingTermLookupTest.php b/client/tests/phpunit/includes/Usage/UsageTrackingTermLookupTest.php index a903845..c89277f 100644 --- a/client/tests/phpunit/includes/Usage/UsageTrackingTermLookupTest.php +++ b/client/tests/phpunit/includes/Usage/UsageTrackingTermLookupTest.php @@ -5,7 +5,7 @@ use Wikibase\Client\Usage\HashUsageAccumulator; use Wikibase\Client\Usage\UsageTrackingTermLookup; use Wikibase\DataModel\Entity\ItemId; -use Wikibase\Lib\Store\TermLookup; +use Wikibase\DataModel\Services\Lookup\TermLookup; /** * @covers Wikibase\Client\Usage\UsageTrackingTermLookup @@ -23,7 +23,7 @@ * @return TermLookup */ private function getMockTermLookup( $method, $p1, $p2 ) { - $mockLookup = $this->getMock( 'Wikibase\Lib\Store\TermLookup' ); + $mockLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\TermLookup' ); $mockLookup->expects( $this->once() ) ->method( $method ) ->with( $p1, $p2 ) diff --git a/client/tests/phpunit/includes/store/sql/DirectSqlStoreTest.php b/client/tests/phpunit/includes/store/sql/DirectSqlStoreTest.php index 04655df..ec69f08 100644 --- a/client/tests/phpunit/includes/store/sql/DirectSqlStoreTest.php +++ b/client/tests/phpunit/includes/store/sql/DirectSqlStoreTest.php @@ -45,7 +45,7 @@ public function provideGetters() { return array( array( 'getSiteLinkLookup', 'Wikibase\Lib\Store\SiteLinkLookup' ), - array( 'getEntityLookup', 'Wikibase\Lib\Store\EntityLookup' ), + array( 'getEntityLookup', 'Wikibase\DataModel\Services\Lookup\EntityLookup' ), array( 'getTermIndex', 'Wikibase\TermIndex' ), array( 'getPropertyLabelResolver', 'Wikibase\PropertyLabelResolver' ), array( 'newChangesTable', 'Wikibase\ChangesTable' ), diff --git a/lib/includes/EntityRetrievingDataTypeLookup.php b/lib/includes/EntityRetrievingDataTypeLookup.php deleted file mode 100644 index d86eee6..0000000 --- a/lib/includes/EntityRetrievingDataTypeLookup.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -namespace Wikibase\Lib; - -use Wikibase\DataModel\Entity\Property; -use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup; -use Wikibase\DataModel\Services\Lookup\PropertyNotFoundException; -use Wikibase\Lib\Store\EntityLookup; - -/** - * PropertyDataTypeLookup that uses an EntityLookup to find - * a property's data type ID. - * - * @since 0.4 - * - * @licence GNU GPL v2+ - * @author Jeroen De Dauw < jeroended...@gmail.com > - */ -class EntityRetrievingDataTypeLookup implements PropertyDataTypeLookup { - - private $entityLookup; - - public function __construct( EntityLookup $entityLookup ) { - $this->entityLookup = $entityLookup; - } - - /** - * @since 0.4 - * - * @param PropertyId $propertyId - * - * @return string - * @throws PropertyNotFoundException - */ - public function getDataTypeIdForProperty( PropertyId $propertyId ) { - return $this->getProperty( $propertyId )->getDataTypeId(); - } - - /** - * @param PropertyId $propertyId - * - * @return Property - * @throws PropertyNotFoundException - */ - private function getProperty( PropertyId $propertyId ) { - $property = $this->entityLookup->getEntity( $propertyId ); - - if ( !( $property instanceof Property ) ) { - throw new PropertyNotFoundException( $propertyId ); - } - - return $property; - } - -} diff --git a/lib/includes/formatters/EntityIdHtmlLinkFormatter.php b/lib/includes/formatters/EntityIdHtmlLinkFormatter.php index 2d7dd97..916f298 100644 --- a/lib/includes/formatters/EntityIdHtmlLinkFormatter.php +++ b/lib/includes/formatters/EntityIdHtmlLinkFormatter.php @@ -7,7 +7,7 @@ use Wikibase\DataModel\Term\Term; use Wikibase\DataModel\Term\TermFallback; use Wikibase\Lib\Store\EntityTitleLookup; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; /** * Formats entity IDs by generating an HTML link to the corresponding page title. diff --git a/lib/includes/formatters/EntityIdLabelFormatter.php b/lib/includes/formatters/EntityIdLabelFormatter.php index edda2b2..d464793 100644 --- a/lib/includes/formatters/EntityIdLabelFormatter.php +++ b/lib/includes/formatters/EntityIdLabelFormatter.php @@ -6,7 +6,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Services\EntityId\EntityIdFormatter; use Wikibase\DataModel\Term\Term; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; /** * @since 0.4 diff --git a/lib/includes/formatters/EntityLabelUnitFormatter.php b/lib/includes/formatters/EntityLabelUnitFormatter.php index b3e6736..11aa8d2 100644 --- a/lib/includes/formatters/EntityLabelUnitFormatter.php +++ b/lib/includes/formatters/EntityLabelUnitFormatter.php @@ -6,7 +6,7 @@ use ValueFormatters\QuantityUnitFormatter; use Wikibase\DataModel\Services\EntityId\EntityIdParser; use Wikibase\DataModel\Services\EntityId\EntityIdParsingException; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; /** * QuantityUnitFormatter for representing units by their respective entity label. diff --git a/lib/includes/formatters/FormatterLabelDescriptionLookupFactory.php b/lib/includes/formatters/FormatterLabelDescriptionLookupFactory.php index d539852..6178f2c 100644 --- a/lib/includes/formatters/FormatterLabelDescriptionLookupFactory.php +++ b/lib/includes/formatters/FormatterLabelDescriptionLookupFactory.php @@ -6,10 +6,10 @@ use ValueFormatters\FormatterOptions; use ValueFormatters\ValueFormatter; use Wikibase\LanguageFallbackChain; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookup; -use Wikibase\Lib\Store\LanguageLabelDescriptionLookup; -use Wikibase\Lib\Store\TermLookup; +use Wikibase\DataModel\Services\Lookup\LanguageLabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\TermLookup; /** * Factory for LabelDescriptionLookup objects based on FormatterOptions. diff --git a/lib/includes/store/EntityInfoTermLookup.php b/lib/includes/store/EntityInfoTermLookup.php index 32ac775..750ec67 100644 --- a/lib/includes/store/EntityInfoTermLookup.php +++ b/lib/includes/store/EntityInfoTermLookup.php @@ -4,6 +4,7 @@ use OutOfBoundsException; use Wikibase\DataModel\Entity\EntityId; +use Wikibase\DataModel\Services\Lookup\TermLookup; /** * TermLookup based on plain array data structures. diff --git a/lib/includes/store/EntityLookup.php b/lib/includes/store/EntityLookup.php deleted file mode 100644 index b8c941a..0000000 --- a/lib/includes/store/EntityLookup.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -namespace Wikibase\Lib\Store; - -use Wikibase\DataModel\Entity\EntityDocument; -use Wikibase\DataModel\Entity\EntityId; - -/** - * Service interface for retrieving Entities from storage. - * - * @since 0.3 - * - * @licence GNU GPL v2+ - * @author Jeroen De Dauw < jeroended...@gmail.com > - * @author Daniel Kinzler - */ -interface EntityLookup { - - /** - * Returns the entity with the provided id or null if there is no such - * entity. - * - * @note Implementations of this method may or may not resolve redirects. - * Code that needs control over redirect resolution should use an - * EntityRevisionLookup instead. - * - * @since 0.3 - * - * @param EntityId $entityId - * - * @throws StorageException - * @return EntityDocument|null - */ - public function getEntity( EntityId $entityId ); - - /** - * Returns whether the given entity can bee looked up using - * getEntity(). This avoids loading and deserializing entity content - * just to check whether the entity exists. - * - * @note Implementations of this method may or may not resolve redirects. - * Code that needs control over redirect resolution should use an - * EntityRevisionLookup instead. - * - * @since 0.4 - * - * @param EntityId $entityId - * - * @throws StorageException - * @return bool - */ - public function hasEntity( EntityId $entityId ); - -} diff --git a/lib/includes/store/EntityRedirectLookup.php b/lib/includes/store/EntityRedirectLookup.php deleted file mode 100644 index 40a128e..0000000 --- a/lib/includes/store/EntityRedirectLookup.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Wikibase\Lib\Store; - -use Wikibase\DataModel\Entity\EntityId; - -/** - * Service interface for retrieving information about entity redirects. - * - * @since 0.5 - * - * @licence GNU GPL v2+ - * @author Daniel Kinzler - */ -interface EntityRedirectLookup { - - /** - * Returns the IDs that redirect to (are aliases of) the given target entity. - * - * @since 0.5 - * - * @param EntityId $targetId - * - * @return EntityId[] - */ - public function getRedirectIds( EntityId $targetId ); - - /** - * Returns the redirect target associated with the given redirect ID. - * - * @since 0.5 - * - * @param EntityId $entityId - * @param string $forUpdate If "for update" is given the redirect will be - * determined from the canonical master database. - * - * @return EntityId|null|false The ID of the redirect target, or null if $entityId - * does not refer to a redirect, or false if $entityId is not known. - */ - public function getRedirectForEntityId( EntityId $entityId, $forUpdate = '' ); - -} diff --git a/lib/includes/store/EntityRetrievingTermLookup.php b/lib/includes/store/EntityRetrievingTermLookup.php deleted file mode 100644 index 335694f..0000000 --- a/lib/includes/store/EntityRetrievingTermLookup.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php - -namespace Wikibase\Lib\Store; - -use OutOfBoundsException; -use Wikibase\DataModel\Term\Fingerprint; -use Wikibase\DataModel\Entity\EntityId; -use Wikibase\DataModel\Term\FingerprintProvider; - -/** - * @since 0.5 - * - * @licence GNU GPL v2+ - * @author Katie Filbert < aude.w...@gmail.com > - */ -class EntityRetrievingTermLookup implements TermLookup { - - /** - * @var EntityLookup - */ - private $entityLookup; - - /** - * @var Fingerprint[] - */ - private $fingerprints; - - /** - * @param EntityLookup $entityLookup - */ - public function __construct( EntityLookup $entityLookup ) { - $this->entityLookup = $entityLookup; - } - - /** - * @see TermLookup::getLabel() - * - * @param EntityId $entityId - * @param string $languageCode - * - * @return string - */ - public function getLabel( EntityId $entityId, $languageCode ) { - $labels = $this->getFingerprint( $entityId )->getLabels(); - return $labels->getByLanguage( $languageCode )->getText(); - } - - /** - * @see TermLookup::getLabels() - * - * @param EntityId $entityId - * @param string[] $languages - * - * @throws OutOfBoundsException if the entity does not exist - * @return string[] - */ - public function getLabels( EntityId $entityId, array $languages ) { - $labels = $this->getFingerprint( $entityId )->getLabels()->toTextArray(); - - return array_intersect_key( $labels, array_flip( $languages ) ); - } - - /** - * @see TermLookup::getDescription() - * - * @param EntityId $entityId - * @param string $languageCode - * - * @return string - */ - public function getDescription( EntityId $entityId, $languageCode ) { - $descriptions = $this->getFingerprint( $entityId )->getDescriptions(); - return $descriptions->getByLanguage( $languageCode )->getText(); - } - - /** - * @see TermLookup::getDescriptions() - * - * @param EntityId $entityId - * @param string[] $languages - * - * @throws OutOfBoundsException if the entity does not exist - * @return string[] - */ - public function getDescriptions( EntityId $entityId, array $languages ) { - $descriptions = $this->getFingerprint( $entityId )->getDescriptions()->toTextArray(); - - return array_intersect_key( $descriptions, array_flip( $languages ) ); - } - - /** - * @param EntityId $entityId - * - * @return Fingerprint - */ - private function getFingerprint( EntityId $entityId ) { - $idSerialization = $entityId->getSerialization(); - - if ( !isset( $this->fingerprints[$idSerialization] ) ) { - $this->fingerprints[$idSerialization] = $this->fetchFingerprint( $entityId ); - } - - return $this->fingerprints[$idSerialization]; - } - - /** - * @param EntityId $entityId - * - * @throws OutOfBoundsException - * @return Fingerprint - */ - private function fetchFingerprint( EntityId $entityId ) { - try { - $entity = $this->entityLookup->getEntity( $entityId ); - } catch ( UnresolvedRedirectException $ex ) { - $entity = null; - } catch ( StorageException $ex ) { - $entity = null; - wfLogWarning( 'Failed to load entity: ' - . $entityId->getSerialization() . ': ' - . $ex->getMessage() ); - } - - if ( $entity === null ) { - // double redirect, deleted entity, etc - throw new OutOfBoundsException( "An Entity with the id $entityId could not be loaded" ); - } - - return $entity instanceof FingerprintProvider ? $entity->getFingerprint() : new Fingerprint(); - } - -} diff --git a/lib/includes/store/EntityTermLookupBase.php b/lib/includes/store/EntityTermLookupBase.php index dd2bc07..7dced4f 100644 --- a/lib/includes/store/EntityTermLookupBase.php +++ b/lib/includes/store/EntityTermLookupBase.php @@ -4,6 +4,7 @@ use OutOfBoundsException; use Wikibase\DataModel\Entity\EntityId; +use Wikibase\DataModel\Services\Lookup\TermLookup; use Wikibase\TermIndexEntry; /** diff --git a/lib/includes/store/LabelDescriptionLookup.php b/lib/includes/store/LabelDescriptionLookup.php deleted file mode 100644 index 9f9aa86..0000000 --- a/lib/includes/store/LabelDescriptionLookup.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Wikibase\Lib\Store; - -use OutOfBoundsException; -use Wikibase\DataModel\Entity\EntityId; -use Wikibase\DataModel\Term\Term; - -/** - * @since 0.5 - * - * @licence GNU GPL v2+ - * @author Katie Filbert < aude.w...@gmail.com > - * @author Marius Hoch < h...@online.de > - */ -interface LabelDescriptionLookup { - - /** - * @param EntityId $entityId - * - * @throws OutOfBoundsException if no such label or entity could be found - * @return Term - */ - public function getLabel( EntityId $entityId ); - - /** - * @param EntityId $entityId - * - * @throws OutOfBoundsException if no such description or entity could be found - * @return Term - */ - public function getDescription( EntityId $entityId ); - -} diff --git a/lib/includes/store/LanguageFallbackLabelDescriptionLookup.php b/lib/includes/store/LanguageFallbackLabelDescriptionLookup.php index 9dee7cf..a153ef5 100644 --- a/lib/includes/store/LanguageFallbackLabelDescriptionLookup.php +++ b/lib/includes/store/LanguageFallbackLabelDescriptionLookup.php @@ -4,6 +4,8 @@ use OutOfBoundsException; use Wikibase\DataModel\Entity\EntityId; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\TermLookup; use Wikibase\DataModel\Term\Term; use Wikibase\DataModel\Term\TermFallback; use Wikibase\LanguageFallbackChain; diff --git a/lib/includes/store/LanguageLabelDescriptionLookup.php b/lib/includes/store/LanguageLabelDescriptionLookup.php deleted file mode 100644 index 5746b4b..0000000 --- a/lib/includes/store/LanguageLabelDescriptionLookup.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -namespace Wikibase\Lib\Store; - -use OutOfBoundsException; -use Wikibase\DataModel\Entity\EntityId; -use Wikibase\DataModel\Term\Term; - -/** - * @since 0.5 - * - * @licence GNU GPL v2+ - * @author Katie Filbert < aude.w...@gmail.com > - * @author Marius Hoch < h...@online.de > - */ -class LanguageLabelDescriptionLookup implements LabelDescriptionLookup { - - /** - * @var TermLookup - */ - private $termLookup; - - /** - * @var string - */ - private $languageCode; - - /** - * @param TermLookup $termLookup - * @param string $languageCode - */ - public function __construct( TermLookup $termLookup, $languageCode ) { - $this->termLookup = $termLookup; - $this->languageCode = $languageCode; - } - - /** - * @param EntityId $entityId - * - * @throws OutOfBoundsException - * @return Term - */ - public function getLabel( EntityId $entityId ) { - $text = $this->termLookup->getLabel( $entityId, $this->languageCode ); - return new Term( $this->languageCode, $text ); - } - - /** - * @param EntityId $entityId - * - * @throws OutOfBoundsException if no such description or entity could be found - * @return Term - */ - public function getDescription( EntityId $entityId ) { - $text = $this->termLookup->getDescription( $entityId, $this->languageCode ); - return new Term( $this->languageCode, $text ); - } - -} diff --git a/lib/includes/store/RedirectResolvingEntityLookup.php b/lib/includes/store/RedirectResolvingEntityLookup.php index b52e7a3..e7da7d3 100644 --- a/lib/includes/store/RedirectResolvingEntityLookup.php +++ b/lib/includes/store/RedirectResolvingEntityLookup.php @@ -4,6 +4,7 @@ use Wikibase\DataModel\Entity\EntityDocument; use Wikibase\DataModel\Entity\EntityId; +use Wikibase\DataModel\Services\Lookup\EntityLookup; /** * Implementation of EntityLookup that opaquely resolves one level diff --git a/lib/includes/store/RevisionBasedEntityLookup.php b/lib/includes/store/RevisionBasedEntityLookup.php index 0317195..868fc89 100644 --- a/lib/includes/store/RevisionBasedEntityLookup.php +++ b/lib/includes/store/RevisionBasedEntityLookup.php @@ -4,6 +4,7 @@ use Wikibase\DataModel\Entity\EntityDocument; use Wikibase\DataModel\Entity\EntityId; +use Wikibase\DataModel\Services\Lookup\EntityLookup; /** * An implementation of EntityLookup based on an EntityRevisionLookup. diff --git a/lib/includes/store/TermLookup.php b/lib/includes/store/TermLookup.php deleted file mode 100644 index 9af057b..0000000 --- a/lib/includes/store/TermLookup.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -namespace Wikibase\Lib\Store; - -use OutOfBoundsException; -use Wikibase\DataModel\Entity\EntityId; - -/** - * A service interface for looking up entity terms. - * - * @note: A TermLookup cannot be used to determine whether an entity exists or not. - * - * @since 0.5 - * - * @licence GNU GPL v2+ - * @author Katie Filbert < aude.w...@gmail.com > - */ -interface TermLookup { - - /** - * Gets the label of an Entity with the specified EntityId and language code. - * - * @param EntityId $entityId - * @param string $languageCode - * - * @throws OutOfBoundsException for label or entity not found - * @return string - */ - public function getLabel( EntityId $entityId, $languageCode ); - - /** - * Gets all labels of an Entity with the specified EntityId. - * - * The result will contain the entries for the requested languages, if they exist. - * - * @param EntityId $entityId - * @param string[] $languageCodes The list of languages to fetch - * - * @throws OutOfBoundsException if the entity was not found (not guaranteed). - * @return string[] labels, keyed by language. - * An empty array may or may not indicate that the entity does not exist. - */ - public function getLabels( EntityId $entityId, array $languageCodes ); - - /** - * Gets the description of an Entity with the specified EntityId and language code. - * - * @param EntityId $entityId - * @param string $languageCode - * - * @throws OutOfBoundsException for description or entity not found - * @return string - */ - public function getDescription( EntityId $entityId, $languageCode ); - - /** - * Gets all descriptions of an Entity with the specified EntityId. - * - * If $languages is given, the result will contain the entries for the - * requested languages, if they exist. - * - * @param EntityId $entityId - * @param string[] $languageCodes The list of languages to fetch - * - * @throws OutOfBoundsException if the entity was not found (not guaranteed). - * @return string[] descriptions, keyed by language. - * An empty array may or may not indicate that the entity does not exist. - */ - public function getDescriptions( EntityId $entityId, array $languageCodes ); - -} diff --git a/lib/tests/phpunit/EntityRetrievingDataTypeLookupTest.php b/lib/tests/phpunit/EntityRetrievingDataTypeLookupTest.php deleted file mode 100644 index defabcc..0000000 --- a/lib/tests/phpunit/EntityRetrievingDataTypeLookupTest.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -namespace Wikibase\Lib\Test; - -use Wikibase\DataModel\Entity\Property; -use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\Lib\EntityRetrievingDataTypeLookup; -use Wikibase\Lib\Store\EntityLookup; -use Wikibase\Test\MockRepository; - -/** - * @covers Wikibase\Lib\EntityRetrievingDataTypeLookup - * - * @group Wikibase - * @group WikibaseLib - * @group DataTypeLookupTest - * - * @licence GNU GPL v2+ - * @author Jeroen De Dauw < jeroended...@gmail.com > - */ -class EntityRetrievingDataTypeLookupTest extends \PHPUnit_Framework_TestCase { - - private $propertiesAndTypes = array( - 'P1' => 'NyanData all the way across the sky', - 'P42' => 'string', - 'P1337' => 'percentage', - 'P9001' => 'positive whole number', - ); - - /** - * @return EntityLookup - */ - private function newEntityLookup() { - $lookup = new MockRepository(); - - foreach ( $this->propertiesAndTypes as $propertyId => $dataTypeId ) { - $property = Property::newFromType( $dataTypeId ); - $property->setId( new PropertyId( $propertyId ) ); - - $lookup->putEntity( $property ); - } - - return $lookup; - } - - public function getDataTypeForPropertyProvider() { - $argLists = array(); - - foreach ( $this->propertiesAndTypes as $propertyId => $dataTypeId ) { - $argLists[] = array( - new PropertyId( $propertyId ), - $dataTypeId - ); - } - - return $argLists; - } - - /** - * @dataProvider getDataTypeForPropertyProvider - * - * @param PropertyId $propertyId - * @param string $expectedDataType - */ - public function testGetDataTypeForProperty( PropertyId $propertyId, $expectedDataType ) { - $lookup = new EntityRetrievingDataTypeLookup( $this->newEntityLookup() ); - - $actualDataType = $lookup->getDataTypeIdForProperty( $propertyId ); - $this->assertInternalType( 'string', $actualDataType ); - - $this->assertEquals( $expectedDataType, $actualDataType ); - } - - // TODO: tests for not found - -} diff --git a/lib/tests/phpunit/MockRepository.php b/lib/tests/phpunit/MockRepository.php index 8c5adc8..641a802 100644 --- a/lib/tests/phpunit/MockRepository.php +++ b/lib/tests/phpunit/MockRepository.php @@ -20,9 +20,9 @@ use Wikibase\DataModel\Term\FingerprintProvider; use Wikibase\EntityRevision; use Wikibase\Lib\Store\EntityInfoBuilderFactory; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\EntityRedirect; -use Wikibase\Lib\Store\EntityRedirectLookup; +use Wikibase\DataModel\Services\Lookup\EntityRedirectLookup; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStore; use Wikibase\Lib\Store\GenericEntityInfoBuilder; diff --git a/lib/tests/phpunit/PropertyInfoDataTypeLookupTest.php b/lib/tests/phpunit/PropertyInfoDataTypeLookupTest.php index df074ab..dc37956 100644 --- a/lib/tests/phpunit/PropertyInfoDataTypeLookupTest.php +++ b/lib/tests/phpunit/PropertyInfoDataTypeLookupTest.php @@ -5,7 +5,7 @@ use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup; -use Wikibase\Lib\EntityRetrievingDataTypeLookup; +use Wikibase\DataModel\Services\Lookup\EntityRetrievingDataTypeLookup; use Wikibase\Lib\PropertyInfoDataTypeLookup; use Wikibase\PropertyInfoStore; use Wikibase\Test\MockPropertyInfoStore; diff --git a/lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php b/lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php index 4812678..c1fbe36 100644 --- a/lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php +++ b/lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php @@ -10,7 +10,7 @@ use Wikibase\DataModel\Term\TermFallback; use Wikibase\Lib\EntityIdHtmlLinkFormatter; use Wikibase\Lib\Store\EntityTitleLookup; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; /** * @covers Wikibase\Lib\EntityIdHtmlLinkFormatter @@ -31,7 +31,7 @@ * @return LabelDescriptionLookup */ private function getLabelDescriptionLookup( Term $term = null ) { - $labelDescriptionLookup = $this->getMock( 'Wikibase\Lib\Store\LabelDescriptionLookup' ); + $labelDescriptionLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup' ); $labelDescriptionLookup->expects( $this->any() ) ->method( 'getLabel' ) ->will( $this->returnValue( $term ?: new Term( 'xy', 'A label' ) ) ); @@ -43,7 +43,7 @@ * @return LabelDescriptionLookup */ private function getLabelDescriptionLookupNoLabel() { - $labelDescriptionLookup = $this->getMock( 'Wikibase\Lib\Store\LabelDescriptionLookup' ); + $labelDescriptionLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup' ); $labelDescriptionLookup->expects( $this->any() ) ->method( 'getLabel' ) ->will( $this->throwException( new OutOfBoundsException( 'meep' ) ) ); diff --git a/lib/tests/phpunit/formatters/EntityIdLabelFormatterTest.php b/lib/tests/phpunit/formatters/EntityIdLabelFormatterTest.php index ec1c518..fb005f6 100644 --- a/lib/tests/phpunit/formatters/EntityIdLabelFormatterTest.php +++ b/lib/tests/phpunit/formatters/EntityIdLabelFormatterTest.php @@ -61,7 +61,7 @@ } protected function getLabelDescriptionLookup( $languageCode ) { - $labelDescriptionLookup = $this->getMockBuilder( 'Wikibase\Lib\Store\LabelDescriptionLookup' ) + $labelDescriptionLookup = $this->getMockBuilder( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup' ) ->disableOriginalConstructor() ->getMock(); diff --git a/lib/tests/phpunit/formatters/EntityLabelUnitFormatterTest.php b/lib/tests/phpunit/formatters/EntityLabelUnitFormatterTest.php index c65ad06..e62d71e 100644 --- a/lib/tests/phpunit/formatters/EntityLabelUnitFormatterTest.php +++ b/lib/tests/phpunit/formatters/EntityLabelUnitFormatterTest.php @@ -40,7 +40,7 @@ * @dataProvider provideApplyUnit */ public function testApplyUnit( $unit, $number, $expected ) { - $labelLookup = $this->getMock( 'Wikibase\Lib\Store\LabelDescriptionLookup' ); + $labelLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup' ); $labelLookup->expects( $this->any() ) ->method( 'getLabel' ) ->will( $this->returnCallback( function( EntityId $id ) { diff --git a/lib/tests/phpunit/formatters/FormatterLabelDescriptionLookupFactoryTest.php b/lib/tests/phpunit/formatters/FormatterLabelDescriptionLookupFactoryTest.php index b61cff5..e1eaf4f 100644 --- a/lib/tests/phpunit/formatters/FormatterLabelDescriptionLookupFactoryTest.php +++ b/lib/tests/phpunit/formatters/FormatterLabelDescriptionLookupFactoryTest.php @@ -10,8 +10,8 @@ use Wikibase\LanguageFallbackChain; use Wikibase\LanguageWithConversion; use Wikibase\Lib\FormatterLabelDescriptionLookupFactory; -use Wikibase\Lib\Store\LanguageLabelDescriptionLookup; -use Wikibase\Lib\Store\TermLookup; +use Wikibase\DataModel\Services\Lookup\LanguageLabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\TermLookup; /** * @covers Wikibase\Lib\FormatterLabelDescriptionLookupFactory @@ -33,14 +33,14 @@ $factory = new FormatterLabelDescriptionLookupFactory( $termLookup ); $labelDescriptionLookup = $factory->getLabelDescriptionLookup( $options ); - $this->assertInstanceOf( 'Wikibase\Lib\Store\LabelDescriptionLookup', $labelDescriptionLookup ); + $this->assertInstanceOf( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup', $labelDescriptionLookup ); $term = $labelDescriptionLookup->getLabel( new ItemId( 'Q1' ) ); $this->assertEquals( $expectedLabel, $term->getText() ); } public function provideGetLabelDescriptionLookup() { - $termLookup = $this->getMock( 'Wikibase\Lib\Store\TermLookup' ); + $termLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\TermLookup' ); $termLookup->expects( $this->any() ) ->method( 'getLabel' ) @@ -99,7 +99,7 @@ * @dataProvider provideGetLabelDescriptionLookup_failure */ public function testGetLabelDescriptionLookup_failure( FormatterOptions $options ) { - $termLookup = $this->getMock( 'Wikibase\Lib\Store\TermLookup' ); + $termLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\TermLookup' ); $factory = new FormatterLabelDescriptionLookupFactory( $termLookup ); $this->setExpectedException( 'InvalidArgumentException' ); diff --git a/lib/tests/phpunit/formatters/WikibaseSnakFormatterBuildersTest.php b/lib/tests/phpunit/formatters/WikibaseSnakFormatterBuildersTest.php index f76840a..8123260 100644 --- a/lib/tests/phpunit/formatters/WikibaseSnakFormatterBuildersTest.php +++ b/lib/tests/phpunit/formatters/WikibaseSnakFormatterBuildersTest.php @@ -58,7 +58,7 @@ return new DataType( $id, $typeMap[$id], array() ); } ) ); - $termLookup = $this->getMock( 'Wikibase\Lib\Store\TermLookup' ); + $termLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\TermLookup' ); $termLookup->expects( $this->any() ) ->method( 'getLabels' ) ->will( $this->returnValue( array( 'en' => 'Label for ' . $entityId->getSerialization() ) ) ); diff --git a/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php b/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php index 61f75e2..832bb4f 100644 --- a/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php +++ b/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php @@ -55,7 +55,7 @@ * @return WikibaseValueFormatterBuilders */ private function newWikibaseValueFormatterBuilders( EntityTitleLookup $entityTitleLookup = null ) { - $termLookup = $this->getMock( 'Wikibase\Lib\Store\TermLookup' ); + $termLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\TermLookup' ); $termLookup->expects( $this->any() ) ->method( 'getLabel' ) @@ -309,7 +309,7 @@ } public function buildDispatchingValueFormatterProvider_LabelDescriptionLookupOption() { - $labelDescriptionLookup = $this->getMock( 'Wikibase\Lib\Store\LabelDescriptionLookup' ); + $labelDescriptionLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup' ); $labelDescriptionLookup->expects( $this->any() ) ->method( 'getLabel' ) ->will( $this->returnValue( new Term( 'xy', 'Custom LabelDescriptionLookup' ) ) ); diff --git a/lib/tests/phpunit/store/CachingEntityRevisionLookupTest.php b/lib/tests/phpunit/store/CachingEntityRevisionLookupTest.php index 4d4aa11..8cf25a8 100644 --- a/lib/tests/phpunit/store/CachingEntityRevisionLookupTest.php +++ b/lib/tests/phpunit/store/CachingEntityRevisionLookupTest.php @@ -6,7 +6,7 @@ use Wikibase\DataModel\Entity\ItemId; use Wikibase\EntityRevision; use Wikibase\Lib\Store\CachingEntityRevisionLookup; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\EntityRedirect; use Wikibase\Lib\Store\UnresolvedRedirectException; diff --git a/lib/tests/phpunit/store/EntityRetrievingTermLookupTest.php b/lib/tests/phpunit/store/EntityRetrievingTermLookupTest.php deleted file mode 100644 index fe08904..0000000 --- a/lib/tests/phpunit/store/EntityRetrievingTermLookupTest.php +++ /dev/null @@ -1,157 +0,0 @@ -<?php - -namespace Wikibase\Test; - -use Wikibase\DataModel\Entity\Item; -use Wikibase\DataModel\Entity\ItemId; -use Wikibase\Lib\Store\EntityLookup; -use Wikibase\Lib\Store\EntityRetrievingTermLookup; - -/** - * @covers Wikibase\Lib\Store\EntityRetrievingTermLookup - * - * @group Wikibase - * @group WikibaseLib - * @group WikibaseStore - * - * @licence GNU GPL v2+ - * @author Katie Filbert < aude.w...@gmail.com > - * @author Daniel Kinzler - */ -class EntityRetrievingTermLookupTest extends \PHPUnit_Framework_TestCase { - - public function testGetLabel() { - $termLookup = $this->getEntityRetrievingTermLookup(); - - $label = $termLookup->getLabel( new ItemId( 'Q116' ), 'en' ); - $this->assertEquals( 'New York City', $label ); - } - - public function testGetLabel_notFoundThrowsException() { - $termLookup = $this->getEntityRetrievingTermLookup(); - - $this->setExpectedException( 'OutOfBoundsException' ); - $termLookup->getLabel( new ItemId( 'Q116' ), 'fa' ); - } - - public function testGetLabel_entityNotFound() { - $termLookup = $this->getEntityRetrievingTermLookup(); - - $this->setExpectedException( 'OutOfBoundsException' ); - $termLookup->getLabel( new ItemId( 'Q120' ), 'en' ); - } - - public function getLabelsProvider() { - return array( - array( - array( 'en' => 'New York City', 'es' => 'Nueva York' ), - new ItemId( 'Q116' ), - array( 'en', 'es' ) - ), - array( - array( 'es' => 'Nueva York' ), - new ItemId( 'Q116' ), - array( 'es' ) - ), - array( - array( 'de' => 'Berlin' ), - new ItemId( 'Q117' ), - array( 'de' ) - ) - ); - } - - /** - * @dataProvider getLabelsProvider - */ - public function testGetLabels( array $expected, ItemId $itemId, array $languageCodes ) { - $termLookup = $this->getEntityRetrievingTermLookup(); - - $labels = $termLookup->getLabels( $itemId, $languageCodes ); - $this->assertEquals( $expected, $labels ); - } - - public function testGetDescription() { - $termLookup = $this->getEntityRetrievingTermLookup(); - - $description = $termLookup->getDescription( new ItemId( 'Q116' ), 'de' ); - $expected = 'Metropole an der Ostküste der Vereinigten Staaten'; - - $this->assertEquals( $expected, $description ); - } - - public function testGetDescription_notFoundThrowsException() { - $termLookup = $this->getEntityRetrievingTermLookup(); - - $this->setExpectedException( 'OutOfBoundsException' ); - $termLookup->getDescription( new ItemId( 'Q116' ), 'fr' ); - } - - public function getDescriptionsProvider() { - return array( - array( - array( - 'de' => 'Metropole an der Ostküste der Vereinigten Staaten', - 'en' => 'largest city in New York and the United States of America', - ), - new ItemId( 'Q116' ), - array( 'de', 'en' ) - ), - array( - array( - 'de' => 'Metropole an der Ostküste der Vereinigten Staaten', - ), - new ItemId( 'Q116' ), - array( 'de', 'fr' ) - ), - array( - array(), - new ItemId( 'Q117' ), - array() - ) - ); - } - - /** - * @dataProvider getDescriptionsProvider - */ - public function testGetDescriptions( array $expected, ItemId $itemId, array $languageCodes ) { - $termLookup = $this->getEntityRetrievingTermLookup(); - - $descriptions = $termLookup->getDescriptions( $itemId, $languageCodes ); - $this->assertEquals( $expected, $descriptions ); - } - - /** - * @return EntityRetrievingTermLookup - */ - private function getEntityRetrievingTermLookup() { - return new EntityRetrievingTermLookup( $this->getEntityLookup() ); - } - - /** - * @return EntityLookup - */ - private function getEntityLookup() { - $mockRepo = new MockRepository(); - - $item = new Item( new ItemId( 'Q116' ) ); - - $item->setLabel( 'en', 'New York City' ); - $item->setLabel( 'es', 'Nueva York' ); - - $item->setDescription( 'de', 'Metropole an der Ostküste der Vereinigten Staaten' ); - $item->setDescription( 'en', 'largest city in New York and the United States of America' ); - - $mockRepo->putEntity( $item ); - - $item = new Item( new ItemId( 'Q117' ) ); - - $item->setLabel( 'de', 'Berlin' ); - - $mockRepo->putEntity( $item ); - - return $mockRepo; - } - -} diff --git a/lib/tests/phpunit/store/LanguageLabelDescriptionLookupTest.php b/lib/tests/phpunit/store/LanguageLabelDescriptionLookupTest.php deleted file mode 100644 index 0d78c26..0000000 --- a/lib/tests/phpunit/store/LanguageLabelDescriptionLookupTest.php +++ /dev/null @@ -1,124 +0,0 @@ -<?php - -namespace Wikibase\Test; - -use MediaWikiTestCase; -use Wikibase\DataModel\Entity\ItemId; -use Wikibase\Lib\Store\EntityTermLookup; -use Wikibase\Lib\Store\LanguageLabelDescriptionLookup; -use Wikibase\TermIndexEntry; - -/** - * @covers Wikibase\Lib\Store\LanguageLabelDescriptionLookup - * - * @group Wikibase - * @group WikibaseLib - * @group WikibaseStore - * - * @licence GNU GPL v2+ - * @author Katie Filbert < aude.w...@gmail.com > - * @author Marius Hoch < h...@online.de > - */ -class LanguageLabelDescriptionLookupTest extends MediaWikiTestCase { - - public function testGetLabel() { - $termLookup = $this->getTermLookup(); - $labelDescriptionLookup = new LanguageLabelDescriptionLookup( $termLookup, 'en' ); - - $term = $labelDescriptionLookup->getLabel( new ItemId( 'Q116' ) ); - - $this->assertEquals( 'New York City', $term->getText() ); - $this->assertEquals( 'en', $term->getLanguageCode() ); - } - - public function testGetLabel_entityNotFound() { - $termLookup = $this->getTermLookup(); - $labelDescriptionLookup = new LanguageLabelDescriptionLookup( $termLookup, 'en' ); - - $this->setExpectedException( 'OutOfBoundsException' ); - $labelDescriptionLookup->getLabel( new ItemId( 'Q120' ) ); - } - - public function testGetLabel_notFound() { - $termLookup = $this->getTermLookup(); - $labelDescriptionLookup = new LanguageLabelDescriptionLookup( $termLookup, 'fa' ); - - $this->setExpectedException( 'OutOfBoundsException' ); - - $labelDescriptionLookup->getLabel( new ItemId( 'Q116' ) ); - } - - public function testGetDescription() { - $termLookup = $this->getTermLookup(); - $labelDescriptionLookup = new LanguageLabelDescriptionLookup( $termLookup, 'en' ); - - $term = $labelDescriptionLookup->getDescription( new ItemId( 'Q116' ) ); - - $this->assertEquals( 'Big Apple', $term->getText() ); - $this->assertEquals( 'en', $term->getLanguageCode() ); - } - - public function testGetDescription_entityNotFound() { - $termLookup = $this->getTermLookup(); - $labelDescriptionLookup = new LanguageLabelDescriptionLookup( $termLookup, 'en' ); - - $this->setExpectedException( 'OutOfBoundsException' ); - $labelDescriptionLookup->getDescription( new ItemId( 'Q120' ) ); - } - - public function testGetDescription_notFound() { - $termLookup = $this->getTermLookup(); - $labelDescriptionLookup = new LanguageLabelDescriptionLookup( $termLookup, 'fa' ); - - $this->setExpectedException( 'OutOfBoundsException' ); - - $labelDescriptionLookup->getDescription( new ItemId( 'Q116' ) ); - } - - private function getTermLookup() { - return new EntityTermLookup( $this->getTermIndex() ); - } - - private function getTermIndex() { - $terms = array( - new TermIndexEntry( array( - 'entityId' => 116, - 'entityType' => 'item', - 'termType' => 'label', - 'termLanguage' => 'en', - 'termText' => 'New York City' - ) ), - new TermIndexEntry( array( - 'entityId' => 116, - 'entityType' => 'item', - 'termType' => 'label', - 'termLanguage' => 'es', - 'termText' => 'New York City' - ) ), - new TermIndexEntry( array( - 'entityId' => 116, - 'entityType' => 'item', - 'termType' => 'description', - 'termLanguage' => 'en', - 'termText' => 'Big Apple' - ) ), - new TermIndexEntry( array( - 'entityId' => 117, - 'entityType' => 'item', - 'termType' => 'label', - 'termLanguage' => 'en', - 'termText' => 'Berlin' - ) ), - new TermIndexEntry( array( - 'entityId' => 118, - 'entityType' => 'item', - 'termType' => 'label', - 'termLanguage' => 'zh-cn', - 'termText' => '测试' - ) ), - ); - - return new MockTermIndex( $terms ); - } - -} diff --git a/lib/tests/phpunit/store/RedirectResolvingEntityLookupTest.php b/lib/tests/phpunit/store/RedirectResolvingEntityLookupTest.php index 7a3c707..fde07c3 100644 --- a/lib/tests/phpunit/store/RedirectResolvingEntityLookupTest.php +++ b/lib/tests/phpunit/store/RedirectResolvingEntityLookupTest.php @@ -5,7 +5,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\RedirectResolvingEntityLookup; use Wikibase\Lib\Store\UnresolvedRedirectException; @@ -59,7 +59,7 @@ * @return EntityLookup */ public function getLookupDouble() { - $mock = $this->getMock( 'Wikibase\Lib\Store\EntityLookup' ); + $mock = $this->getMock( 'Wikibase\DataModel\Services\Lookup\EntityLookup' ); $mock->expects( $this->any() ) ->method( 'getEntity' ) diff --git a/repo/includes/Diff/EntityContentDiffView.php b/repo/includes/Diff/EntityContentDiffView.php index c78a662..2dd16e7 100644 --- a/repo/includes/Diff/EntityContentDiffView.php +++ b/repo/includes/Diff/EntityContentDiffView.php @@ -23,8 +23,8 @@ use Wikibase\Lib\EscapingEntityIdFormatter; use Wikibase\Lib\LanguageNameLookup; use Wikibase\Lib\SnakFormatter; -use Wikibase\Lib\Store\EntityRetrievingTermLookup; -use Wikibase\Lib\Store\LanguageLabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\EntityRetrievingTermLookup; +use Wikibase\DataModel\Services\Lookup\LanguageLabelDescriptionLookup; use Wikibase\Repo\WikibaseRepo; use WikiPage; diff --git a/repo/includes/Dumpers/JsonDumpGenerator.php b/repo/includes/Dumpers/JsonDumpGenerator.php index 48c7ecd..cc42937 100644 --- a/repo/includes/Dumpers/JsonDumpGenerator.php +++ b/repo/includes/Dumpers/JsonDumpGenerator.php @@ -12,7 +12,7 @@ use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup; use Wikibase\Lib\Serialization\CallbackFactory; use Wikibase\Lib\Serialization\SerializationModifier; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\RedirectResolvingEntityLookup; use Wikibase\Lib\Store\StorageException; use Wikibase\Lib\Store\UnresolvedRedirectException; diff --git a/repo/includes/EntityIdHtmlLinkFormatterFactory.php b/repo/includes/EntityIdHtmlLinkFormatterFactory.php index f708c9e..7fb39c3 100644 --- a/repo/includes/EntityIdHtmlLinkFormatterFactory.php +++ b/repo/includes/EntityIdHtmlLinkFormatterFactory.php @@ -6,7 +6,7 @@ use Wikibase\Lib\LanguageNameLookup; use Wikibase\Lib\SnakFormatter; use Wikibase\Lib\Store\EntityTitleLookup; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; use Wikibase\View\EntityIdFormatterFactory; /** diff --git a/repo/includes/EntityIdLabelFormatterFactory.php b/repo/includes/EntityIdLabelFormatterFactory.php index bec89ad..645ab19 100644 --- a/repo/includes/EntityIdLabelFormatterFactory.php +++ b/repo/includes/EntityIdLabelFormatterFactory.php @@ -4,7 +4,7 @@ use Wikibase\Lib\EntityIdLabelFormatter; use Wikibase\Lib\SnakFormatter; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; use Wikibase\View\EntityIdFormatterFactory; /** diff --git a/repo/includes/Hooks/LinkBeginHookHandler.php b/repo/includes/Hooks/LinkBeginHookHandler.php index b5043a9..f70c595 100644 --- a/repo/includes/Hooks/LinkBeginHookHandler.php +++ b/repo/includes/Hooks/LinkBeginHookHandler.php @@ -11,7 +11,7 @@ use Title; use Wikibase\LanguageFallbackChain; use Wikibase\Lib\Store\StorageException; -use Wikibase\Lib\Store\TermLookup; +use Wikibase\DataModel\Services\Lookup\TermLookup; use Wikibase\Repo\EntityNamespaceLookup; use Wikibase\Repo\WikibaseRepo; use Wikibase\Store\EntityIdLookup; diff --git a/repo/includes/Interactors/RedirectCreationInteractor.php b/repo/includes/Interactors/RedirectCreationInteractor.php index d0f307c..4ad02da 100644 --- a/repo/includes/Interactors/RedirectCreationInteractor.php +++ b/repo/includes/Interactors/RedirectCreationInteractor.php @@ -5,7 +5,7 @@ use User; use Wikibase\DataModel\Entity\EntityId; use Wikibase\Lib\Store\EntityRedirect; -use Wikibase\Lib\Store\EntityRedirectLookup; +use Wikibase\DataModel\Services\Lookup\EntityRedirectLookup; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStore; use Wikibase\Lib\Store\StorageException; diff --git a/repo/includes/LanguageFallbackLabelDescriptionLookupFactory.php b/repo/includes/LanguageFallbackLabelDescriptionLookupFactory.php index 471a5f6..cb86697 100644 --- a/repo/includes/LanguageFallbackLabelDescriptionLookupFactory.php +++ b/repo/includes/LanguageFallbackLabelDescriptionLookupFactory.php @@ -5,9 +5,9 @@ use Language; use Wikibase\DataModel\Entity\EntityId; use Wikibase\LanguageFallbackChainFactory; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookup; -use Wikibase\Lib\Store\TermLookup; +use Wikibase\DataModel\Services\Lookup\TermLookup; use Wikibase\Store\TermBuffer; /** diff --git a/repo/includes/LinkedData/EntityDataRequestHandler.php b/repo/includes/LinkedData/EntityDataRequestHandler.php index 765cba3..b5ccac7 100644 --- a/repo/includes/LinkedData/EntityDataRequestHandler.php +++ b/repo/includes/LinkedData/EntityDataRequestHandler.php @@ -13,7 +13,7 @@ use Wikibase\EntityRevision; use Wikibase\Lib\Store\BadRevisionException; use Wikibase\Lib\Store\EntityRedirect; -use Wikibase\Lib\Store\EntityRedirectLookup; +use Wikibase\DataModel\Services\Lookup\EntityRedirectLookup; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Lib\Store\StorageException; diff --git a/repo/includes/LinkedData/EntityDataSerializationService.php b/repo/includes/LinkedData/EntityDataSerializationService.php index 7be6296..28f5ede 100644 --- a/repo/includes/LinkedData/EntityDataSerializationService.php +++ b/repo/includes/LinkedData/EntityDataSerializationService.php @@ -15,7 +15,7 @@ use Wikibase\DataModel\SerializerFactory; use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup; use Wikibase\EntityRevision; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\EntityRedirect; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Rdf\HashDedupeBag; diff --git a/repo/includes/ValidatorBuilders.php b/repo/includes/ValidatorBuilders.php index 86b310d..9e1347d 100644 --- a/repo/includes/ValidatorBuilders.php +++ b/repo/includes/ValidatorBuilders.php @@ -8,7 +8,7 @@ use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\Services\EntityId\EntityIdParser; use Wikibase\Lib\ContentLanguages; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Repo\Validators\AlternativeValidator; use Wikibase\Repo\Validators\CompositeValidator; use Wikibase\Repo\Validators\DataFieldValidator; diff --git a/repo/includes/Validators/EntityExistsValidator.php b/repo/includes/Validators/EntityExistsValidator.php index 40de4ed..61e654e 100644 --- a/repo/includes/Validators/EntityExistsValidator.php +++ b/repo/includes/Validators/EntityExistsValidator.php @@ -8,7 +8,7 @@ use ValueValidators\ValueValidator; use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityIdValue; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; /** * EntityExistsValidator checks that a given entity exists. diff --git a/repo/includes/WikibaseHtmlSnakFormatterFactory.php b/repo/includes/WikibaseHtmlSnakFormatterFactory.php index 8520b30..b220646 100644 --- a/repo/includes/WikibaseHtmlSnakFormatterFactory.php +++ b/repo/includes/WikibaseHtmlSnakFormatterFactory.php @@ -8,7 +8,7 @@ use Wikibase\Lib\FormatterLabelDescriptionLookupFactory; use Wikibase\Lib\OutputFormatSnakFormatterFactory; use Wikibase\Lib\SnakFormatter; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; use Wikibase\View\HtmlSnakFormatterFactory; /** diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php index 5137ba0..7e9a21d 100644 --- a/repo/includes/WikibaseRepo.php +++ b/repo/includes/WikibaseRepo.php @@ -44,7 +44,7 @@ use Wikibase\Lib\EntityIdLinkFormatter; use Wikibase\Lib\EntityIdPlainLinkFormatter; use Wikibase\Lib\EntityIdValueFormatter; -use Wikibase\Lib\EntityRetrievingDataTypeLookup; +use Wikibase\DataModel\Services\Lookup\EntityRetrievingDataTypeLookup; use Wikibase\Lib\FormatterLabelDescriptionLookupFactory; use Wikibase\Lib\LanguageNameLookup; use Wikibase\Repo\Localizer\DispatchingExceptionLocalizer; @@ -57,12 +57,12 @@ use Wikibase\Lib\PropertyInfoDataTypeLookup; use Wikibase\Lib\SnakFormatter; use Wikibase\Lib\Store\EntityContentDataCodec; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStore; use Wikibase\Lib\Store\EntityStoreWatcher; use Wikibase\Lib\Store\EntityTitleLookup; -use Wikibase\Lib\Store\TermLookup; +use Wikibase\DataModel\Services\Lookup\TermLookup; use Wikibase\Lib\WikibaseContentLanguages; use Wikibase\Lib\WikibaseDataTypeBuilders; use Wikibase\Lib\WikibaseSnakFormatterBuilders; diff --git a/repo/includes/actions/EditEntityAction.php b/repo/includes/actions/EditEntityAction.php index 595d849..13fb3b7 100644 --- a/repo/includes/actions/EditEntityAction.php +++ b/repo/includes/actions/EditEntityAction.php @@ -19,8 +19,8 @@ use Wikibase\Lib\EscapingEntityIdFormatter; use Wikibase\Lib\LanguageNameLookup; use Wikibase\Lib\SnakFormatter; -use Wikibase\Lib\Store\EntityRetrievingTermLookup; -use Wikibase\Lib\Store\LanguageLabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\EntityRetrievingTermLookup; +use Wikibase\DataModel\Services\Lookup\LanguageLabelDescriptionLookup; use Wikibase\Repo\Content\EntityContentDiff; use Wikibase\Repo\Diff\ClaimDiffer; use Wikibase\Repo\Diff\ClaimDifferenceVisualizer; diff --git a/repo/includes/api/SearchEntities.php b/repo/includes/api/SearchEntities.php index 3b3f76a..069ed4b 100644 --- a/repo/includes/api/SearchEntities.php +++ b/repo/includes/api/SearchEntities.php @@ -11,7 +11,7 @@ use Wikibase\DataModel\Term\Term; use Wikibase\Lib\ContentLanguages; use Wikibase\Lib\Store\EntityTitleLookup; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookup; use Wikibase\Repo\Interactors\TermIndexSearchInteractor; use Wikibase\Repo\Interactors\TermSearchResult; diff --git a/repo/includes/rdf/RdfBuilder.php b/repo/includes/rdf/RdfBuilder.php index dd91f5b..5b30194 100644 --- a/repo/includes/rdf/RdfBuilder.php +++ b/repo/includes/rdf/RdfBuilder.php @@ -10,7 +10,7 @@ use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup; use Wikibase\DataModel\Term\FingerprintProvider; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\UnresolvedRedirectException; use Wikimedia\Purtle\RdfWriter; diff --git a/repo/includes/specials/SpecialGoToLinkedPage.php b/repo/includes/specials/SpecialGoToLinkedPage.php index b449ed4..7a4846a 100644 --- a/repo/includes/specials/SpecialGoToLinkedPage.php +++ b/repo/includes/specials/SpecialGoToLinkedPage.php @@ -6,10 +6,10 @@ use InvalidArgumentException; use SiteStore; use Wikibase\DataModel\Entity\ItemId; -use Wikibase\Lib\Store\EntityRedirectLookup; +use Wikibase\DataModel\Services\Lookup\EntityRedirectLookup; use Wikibase\Lib\Store\SiteLinkLookup; use Wikibase\Repo\WikibaseRepo; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\DataModel\Services\EntityId\EntityIdParsingException; use Wikibase\DataModel\Services\EntityId\EntityIdParser; diff --git a/repo/includes/store/Store.php b/repo/includes/store/Store.php index 57c6aba..a55c156 100644 --- a/repo/includes/store/Store.php +++ b/repo/includes/store/Store.php @@ -4,8 +4,8 @@ use Wikibase\DataModel\Services\Entity\EntityPrefetcher; use Wikibase\Lib\Store\EntityInfoBuilderFactory; -use Wikibase\Lib\Store\EntityLookup; -use Wikibase\Lib\Store\EntityRedirectLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityRedirectLookup; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStore; use Wikibase\Lib\Store\EntityStoreWatcher; diff --git a/repo/includes/store/sql/ItemsPerSiteBuilder.php b/repo/includes/store/sql/ItemsPerSiteBuilder.php index 4072602..771eed5 100644 --- a/repo/includes/store/sql/ItemsPerSiteBuilder.php +++ b/repo/includes/store/sql/ItemsPerSiteBuilder.php @@ -5,7 +5,7 @@ use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Services\Entity\EntityPrefetcher; use Wikibase\Lib\Reporting\MessageReporter; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\SiteLinkTable; use Wikibase\Repo\Store\EntityIdPager; diff --git a/repo/includes/store/sql/PropertyInfoTableBuilder.php b/repo/includes/store/sql/PropertyInfoTableBuilder.php index 89ef8e6..c314316 100644 --- a/repo/includes/store/sql/PropertyInfoTableBuilder.php +++ b/repo/includes/store/sql/PropertyInfoTableBuilder.php @@ -6,7 +6,7 @@ use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\Entity\PropertyId; use Wikibase\Lib\Reporting\MessageReporter; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; /** * Utility class for rebuilding the wb_property_info table. diff --git a/repo/includes/store/sql/SqlStore.php b/repo/includes/store/sql/SqlStore.php index 0cbd7dc..5fb3a80 100644 --- a/repo/includes/store/sql/SqlStore.php +++ b/repo/includes/store/sql/SqlStore.php @@ -14,8 +14,8 @@ use Wikibase\Lib\Store\CachingEntityRevisionLookup; use Wikibase\Lib\Store\EntityContentDataCodec; use Wikibase\Lib\Store\EntityInfoBuilderFactory; -use Wikibase\Lib\Store\EntityLookup; -use Wikibase\Lib\Store\EntityRedirectLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityRedirectLookup; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStore; use Wikibase\Lib\Store\EntityStoreWatcher; diff --git a/repo/includes/store/sql/WikiPageEntityRedirectLookup.php b/repo/includes/store/sql/WikiPageEntityRedirectLookup.php index 553bc19..240ae6c 100644 --- a/repo/includes/store/sql/WikiPageEntityRedirectLookup.php +++ b/repo/includes/store/sql/WikiPageEntityRedirectLookup.php @@ -4,7 +4,7 @@ use Title; use Wikibase\DataModel\Entity\EntityId; -use Wikibase\Lib\Store\EntityRedirectLookup; +use Wikibase\DataModel\Services\Lookup\EntityRedirectLookup; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Store\EntityIdLookup; diff --git a/repo/maintenance/dumpJson.php b/repo/maintenance/dumpJson.php index 8acbe54..4b55e05 100644 --- a/repo/maintenance/dumpJson.php +++ b/repo/maintenance/dumpJson.php @@ -8,7 +8,7 @@ use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup; use Wikibase\Dumpers\DumpGenerator; use Wikibase\Dumpers\JsonDumpGenerator; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\RevisionBasedEntityLookup; use Wikibase\Repo\Store\EntityPerPage; use Wikibase\Repo\WikibaseRepo; diff --git a/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php b/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php index 6dfee38..ea85a15 100644 --- a/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php +++ b/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php @@ -17,7 +17,7 @@ use Wikibase\DataModel\Services\EntityId\BasicEntityIdParser; use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup; use Wikibase\Dumpers\JsonDumpGenerator; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\UnresolvedRedirectException; use Wikibase\Repo\Store\EntityIdPager; use Wikibase\Repo\WikibaseRepo; @@ -110,7 +110,7 @@ $entities = $this->makeEntities( $ids ); - $entityLookup = $this->getMock( 'Wikibase\Lib\Store\EntityLookup' ); + $entityLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\EntityLookup' ); $entityLookup->expects( $this->any() ) ->method( 'getEntity' ) ->will( $this->returnCallback( function( EntityId $id ) use ( $entities, $missingIds, $redirectedIds ) { @@ -246,7 +246,7 @@ * @return EntityLookup */ private function getEntityLookupThrowsMWContentSerializationException() { - $entityLookup = $this->getMock( 'Wikibase\Lib\Store\EntityLookup' ); + $entityLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\EntityLookup' ); $entityLookup->expects( $this->any() ) ->method( 'getEntity' ) ->will( $this->returnCallback( function( EntityId $id ) { diff --git a/repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php b/repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php index b5bf3a8..d47fe0f 100644 --- a/repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php +++ b/repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php @@ -13,7 +13,7 @@ use Wikibase\DataModel\Services\Entity\NullEntityPrefetcher; use Wikibase\Dumpers\RdfDumpGenerator; use Wikibase\EntityRevision; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\UnresolvedRedirectException; use Wikibase\Test\Rdf\RdfBuilderTest; @@ -69,7 +69,7 @@ protected function newDumpGenerator( array $entities = array(), array $redirects = array() ) { $out = fopen( 'php://output', 'w' ); - $entityLookup = $this->getMock( 'Wikibase\Lib\Store\EntityLookup' ); + $entityLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\EntityLookup' ); $entityRevisionLookup = $this->getMock( 'Wikibase\Lib\Store\EntityRevisionLookup' ); $propertyLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup' ); diff --git a/repo/tests/phpunit/includes/EntityIdHtmlLinkFormatterFactoryTest.php b/repo/tests/phpunit/includes/EntityIdHtmlLinkFormatterFactoryTest.php index ef97043..d65c01a 100644 --- a/repo/tests/phpunit/includes/EntityIdHtmlLinkFormatterFactoryTest.php +++ b/repo/tests/phpunit/includes/EntityIdHtmlLinkFormatterFactoryTest.php @@ -36,7 +36,7 @@ public function testGetEntityIdFormatter() { $factory = $this->getFormatterFactory(); - $formatter = $factory->getEntityIdFormater( $this->getMock( 'Wikibase\Lib\Store\LabelDescriptionLookup' ) ); + $formatter = $factory->getEntityIdFormater( $this->getMock( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup' ) ); $this->assertInstanceOf( 'Wikibase\DataModel\Services\EntityId\EntityIdFormatter', $formatter ); } diff --git a/repo/tests/phpunit/includes/EntityIdLabelFormatterFactoryTest.php b/repo/tests/phpunit/includes/EntityIdLabelFormatterFactoryTest.php index 8760503..ad87dc8 100644 --- a/repo/tests/phpunit/includes/EntityIdLabelFormatterFactoryTest.php +++ b/repo/tests/phpunit/includes/EntityIdLabelFormatterFactoryTest.php @@ -31,7 +31,7 @@ public function testGetEntityIdFormatter() { $factory = $this->getFormatterFactory(); - $formatter = $factory->getEntityIdFormater( $this->getMock( 'Wikibase\Lib\Store\LabelDescriptionLookup' ) ); + $formatter = $factory->getEntityIdFormater( $this->getMock( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup' ) ); $this->assertInstanceOf( 'Wikibase\DataModel\Services\EntityId\EntityIdFormatter', $formatter ); } diff --git a/repo/tests/phpunit/includes/Hooks/LinkBeginHookHandlerTest.php b/repo/tests/phpunit/includes/Hooks/LinkBeginHookHandlerTest.php index 72a35d0..3780c3e 100644 --- a/repo/tests/phpunit/includes/Hooks/LinkBeginHookHandlerTest.php +++ b/repo/tests/phpunit/includes/Hooks/LinkBeginHookHandlerTest.php @@ -12,7 +12,7 @@ use Wikibase\LanguageFallbackChain; use Wikibase\LanguageWithConversion; use Wikibase\Lib\Store\StorageException; -use Wikibase\Lib\Store\TermLookup; +use Wikibase\DataModel\Services\Lookup\TermLookup; use Wikibase\Repo\EntityNamespaceLookup; use Wikibase\Repo\Hooks\LinkBeginHookHandler; use Wikibase\Repo\WikibaseRepo; @@ -248,7 +248,7 @@ * @return TermLookup */ private function getTermLookup() { - $termLookup = $this->getMock( 'Wikibase\Lib\Store\TermLookup' ); + $termLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\TermLookup' ); $termLookup->expects( $this->any() ) ->method( 'getLabels' ) diff --git a/repo/tests/phpunit/includes/LanguageFallbackLabelDescriptionLookupFactoryTest.php b/repo/tests/phpunit/includes/LanguageFallbackLabelDescriptionLookupFactoryTest.php index 9148ff0..8a0accd 100644 --- a/repo/tests/phpunit/includes/LanguageFallbackLabelDescriptionLookupFactoryTest.php +++ b/repo/tests/phpunit/includes/LanguageFallbackLabelDescriptionLookupFactoryTest.php @@ -17,7 +17,7 @@ class LanguageFallbackLabelDescriptionLookupFactoryTest extends \PHPUnit_Framework_TestCase { private function getTermLookupMock() { - $termLookup = $this->getMock( 'Wikibase\Lib\Store\TermLookup' ); + $termLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\TermLookup' ); $termLookup->expects( $this->any() ) ->method( 'getLabel' ) ->will( $this->returnCallback( function( EntityId $entityId ) { diff --git a/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php b/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php index e1cb815..77f7841 100644 --- a/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php +++ b/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php @@ -14,7 +14,7 @@ use Wikibase\DataModel\SerializerFactory; use Wikibase\DataModel\Snak\PropertyValueSnak; use Wikibase\EntityRevision; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\EntityRedirect; use Wikibase\RedirectRevision; use Wikibase\Repo\LinkedData\EntityDataFormatProvider; diff --git a/repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php b/repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php index 2f416d1..b213cd0 100644 --- a/repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php +++ b/repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php @@ -6,7 +6,7 @@ use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Test\MockRepository; use Wikibase\Repo\Validators\EntityExistsValidator; use Wikibase\Repo\Validators\ValidatorErrorLocalizer; diff --git a/repo/tests/phpunit/includes/WikibaseHtmlSnakFormatterFactoryTest.php b/repo/tests/phpunit/includes/WikibaseHtmlSnakFormatterFactoryTest.php index 4774884..0f80cc9 100644 --- a/repo/tests/phpunit/includes/WikibaseHtmlSnakFormatterFactoryTest.php +++ b/repo/tests/phpunit/includes/WikibaseHtmlSnakFormatterFactoryTest.php @@ -24,7 +24,7 @@ public function testGetSnakFormatter() { $snakFormatter = $this->getMock( 'Wikibase\Lib\SnakFormatter' ); $languageFallbackChain = new LanguageFallbackChain( array() ); - $labelDescriptionLookup = $this->getMock( 'Wikibase\Lib\Store\LabelDescriptionLookup' ); + $labelDescriptionLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup' ); $outputFormatSnakFormatterFactory = $this->getMockBuilder( 'Wikibase\Lib\OutputFormatSnakFormatterFactory' ) ->disableOriginalConstructor() diff --git a/repo/tests/phpunit/includes/WikibaseRepoTest.php b/repo/tests/phpunit/includes/WikibaseRepoTest.php index f61f242..319183c 100644 --- a/repo/tests/phpunit/includes/WikibaseRepoTest.php +++ b/repo/tests/phpunit/includes/WikibaseRepoTest.php @@ -66,7 +66,7 @@ public function testGetEntityLookupReturnType() { $returnValue = $this->getWikibaseRepo()->getEntityLookup(); - $this->assertInstanceOf( 'Wikibase\Lib\Store\EntityLookup', $returnValue ); + $this->assertInstanceOf( 'Wikibase\DataModel\Services\Lookup\EntityLookup', $returnValue ); } public function testGetSnakConstructionServiceReturnType() { @@ -231,7 +231,7 @@ public function testGetTermLookup() { $service = $this->getWikibaseRepo()->getTermLookup(); - $this->assertInstanceOf( 'Wikibase\Lib\Store\TermLookup', $service ); + $this->assertInstanceOf( 'Wikibase\DataModel\Services\Lookup\TermLookup', $service ); } public function testGetTermBuffer() { diff --git a/repo/tests/phpunit/includes/api/SearchEntitiesTest.php b/repo/tests/phpunit/includes/api/SearchEntitiesTest.php index 8def18f..7f7ed8a 100644 --- a/repo/tests/phpunit/includes/api/SearchEntitiesTest.php +++ b/repo/tests/phpunit/includes/api/SearchEntitiesTest.php @@ -14,7 +14,7 @@ use Wikibase\DataModel\Term\Term; use Wikibase\Lib\ContentLanguages; use Wikibase\Lib\Store\EntityTitleLookup; -use Wikibase\Lib\Store\LanguageLabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LanguageLabelDescriptionLookup; use Wikibase\Repo\Api\SearchEntities; use Wikibase\Repo\Interactors\TermIndexSearchInteractor; use Wikibase\Repo\Interactors\TermSearchInteractor; @@ -124,7 +124,7 @@ * @return LanguageLabelDescriptionLookup */ private function getMockLabelDescriptionLookup() { - $mock = $this->getMockBuilder( 'Wikibase\Lib\Store\LabelDescriptionLookup' ) + $mock = $this->getMockBuilder( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup' ) ->disableOriginalConstructor() ->getMock(); $mock->expects( $this->any() ) diff --git a/repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php b/repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php index 9f5b8cd..e76235c 100644 --- a/repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php +++ b/repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php @@ -7,8 +7,8 @@ use SiteStore; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Services\EntityId\EntityIdParser; -use Wikibase\Lib\Store\EntityLookup; -use Wikibase\Lib\Store\EntityRedirectLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityRedirectLookup; use Wikibase\Lib\Store\SiteLinkLookup; use Wikibase\Repo\Specials\SpecialGoToLinkedPage; @@ -71,7 +71,7 @@ * @return EntityRedirectLookup */ private function getEntityRedirectLookup() { - $mock = $this->getMock( 'Wikibase\Lib\Store\EntityRedirectLookup' ); + $mock = $this->getMock( 'Wikibase\DataModel\Services\Lookup\EntityRedirectLookup' ); $mock->expects( $this->any() ) ->method( 'getRedirectForEntityId' ) ->will( $this->returnCallback( function( ItemId $itemId ) { @@ -103,7 +103,7 @@ * @return EntityLookup */ private function getEntitylookup() { - $mock = $this->getMock( 'Wikibase\Lib\Store\EntityLookup' ); + $mock = $this->getMock( 'Wikibase\DataModel\Services\Lookup\EntityLookup' ); $mock->expects( $this->any() ) ->method( 'hasEntity' ) ->will( $this->returnCallback( function( ItemId $itemId ) { diff --git a/repo/tests/phpunit/includes/specials/SpecialListPropertiesTest.php b/repo/tests/phpunit/includes/specials/SpecialListPropertiesTest.php index bdb606d..f129b11 100644 --- a/repo/tests/phpunit/includes/specials/SpecialListPropertiesTest.php +++ b/repo/tests/phpunit/includes/specials/SpecialListPropertiesTest.php @@ -68,7 +68,7 @@ } private function getTermLookup() { - $termLookup = $this->getMock( 'Wikibase\Lib\Store\TermLookup' ); + $termLookup = $this->getMock( 'Wikibase\DataModel\Services\Lookup\TermLookup' ); $termLookup->expects( $this->any() ) ->method( 'getLabels' ) ->will( $this->returnCallback( function( PropertyId $propertyId ) { diff --git a/repo/tests/phpunit/includes/store/WikiPageEntityRevisionLookupTest.php b/repo/tests/phpunit/includes/store/WikiPageEntityRevisionLookupTest.php index 049c8b7..8b98b31 100644 --- a/repo/tests/phpunit/includes/store/WikiPageEntityRevisionLookupTest.php +++ b/repo/tests/phpunit/includes/store/WikiPageEntityRevisionLookupTest.php @@ -5,7 +5,7 @@ use Wikibase\DataModel\Entity\Entity; use Wikibase\DataModel\Services\EntityId\BasicEntityIdParser; use Wikibase\EntityRevision; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\EntityRedirect; use Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup; use Wikibase\Lib\Store\WikiPageEntityRevisionLookup; diff --git a/repo/tests/phpunit/includes/store/sql/ItemsPerSiteBuilderTest.php b/repo/tests/phpunit/includes/store/sql/ItemsPerSiteBuilderTest.php index f8a4b06..fbf8534 100644 --- a/repo/tests/phpunit/includes/store/sql/ItemsPerSiteBuilderTest.php +++ b/repo/tests/phpunit/includes/store/sql/ItemsPerSiteBuilderTest.php @@ -5,7 +5,7 @@ use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Services\Entity\NullEntityPrefetcher; -use Wikibase\Lib\Store\EntityLookup; +use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Store\SiteLinkTable; use Wikibase\Repo\Store\EntityIdPager; use Wikibase\Repo\Store\SQL\ItemsPerSiteBuilder; @@ -60,7 +60,7 @@ * @return EntityLookup */ private function getEntityLookup() { - $mock = $this->getMockBuilder( 'Wikibase\Lib\Store\EntityLookup' ) + $mock = $this->getMockBuilder( 'Wikibase\DataModel\Services\Lookup\EntityLookup' ) ->disableOriginalConstructor() ->getMock(); diff --git a/view/src/EntityIdFormatterFactory.php b/view/src/EntityIdFormatterFactory.php index 91daaf2..d8c0b89 100644 --- a/view/src/EntityIdFormatterFactory.php +++ b/view/src/EntityIdFormatterFactory.php @@ -3,7 +3,7 @@ namespace Wikibase\View; use Wikibase\DataModel\Services\EntityId\EntityIdFormatter; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; /** * A factory interface for generating EntityIdFormatters. diff --git a/view/src/EntityViewFactory.php b/view/src/EntityViewFactory.php index 4221701..4d58399 100644 --- a/view/src/EntityViewFactory.php +++ b/view/src/EntityViewFactory.php @@ -9,7 +9,7 @@ use Wikibase\LanguageFallbackChain; use Wikibase\Lib\LanguageNameLookup; use Wikibase\Lib\SnakFormatter; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; use Wikibase\View\Template\TemplateFactory; /** diff --git a/view/src/HtmlSnakFormatterFactory.php b/view/src/HtmlSnakFormatterFactory.php index 47f22a0..8424ded 100644 --- a/view/src/HtmlSnakFormatterFactory.php +++ b/view/src/HtmlSnakFormatterFactory.php @@ -4,7 +4,7 @@ use Wikibase\LanguageFallbackChain; use Wikibase\Lib\SnakFormatter; -use Wikibase\Lib\Store\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; /** * A factory constructing SnakFormatters that output HTML. diff --git a/view/tests/phpunit/EntityViewFactoryTest.php b/view/tests/phpunit/EntityViewFactoryTest.php index effad82..c236fbc 100644 --- a/view/tests/phpunit/EntityViewFactoryTest.php +++ b/view/tests/phpunit/EntityViewFactoryTest.php @@ -45,7 +45,7 @@ $entityView = $entityViewFactory->newEntityView( $entityType, 'de', - $this->getMock( 'Wikibase\Lib\Store\LabelDescriptionLookup' ), + $this->getMock( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup' ), $languageFallback, $this->getMock( 'Wikibase\View\EditSectionGenerator' ) ); @@ -70,7 +70,7 @@ $entityViewFactory->newEntityView( 'kittens', 'de', - $this->getMock( 'Wikibase\Lib\Store\LabelDescriptionLookup' ), + $this->getMock( 'Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup' ), $languageFallback, $this->getMock( 'Wikibase\View\EditSectionGenerator' ) ); -- To view, visit https://gerrit.wikimedia.org/r/230758 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e27eacd5d421b2093bf42f1a1c1e60de9401b8b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Addshore <addshorew...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits