Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/68362
Change subject: Fixed a couple of bad dependencies ...................................................................... Fixed a couple of bad dependencies Change-Id: I8093705d8214924e656262b766a96a4fa980c8fa --- M includes/QueryStore.php M includes/SQLStore/Setup.php M includes/SQLStore/Store.php M tests/integration/SQLStore/Engine/DescriptionMatchFinderIntegrationTest.php M tests/integration/SQLStore/WritingIntegrationTest.php 5 files changed, 29 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQueryEngine refs/changes/62/68362/1 diff --git a/includes/QueryStore.php b/includes/QueryStore.php index bf3c692..530d28c 100644 --- a/includes/QueryStore.php +++ b/includes/QueryStore.php @@ -2,7 +2,7 @@ namespace Wikibase\QueryEngine; -use MessageReporter; +use Wikibase\Database\MessageReporter; /** * Interface for query stores providing access to all needed sub components diff --git a/includes/SQLStore/Setup.php b/includes/SQLStore/Setup.php index a48a39c..e08cda7 100644 --- a/includes/SQLStore/Setup.php +++ b/includes/SQLStore/Setup.php @@ -2,7 +2,7 @@ namespace Wikibase\QueryEngine\SQLStore; -use MessageReporter; +use Wikibase\Database\MessageReporter; use Wikibase\Database\FieldDefinition; use Wikibase\Database\QueryInterface; use Wikibase\Database\QueryInterfaceException; diff --git a/includes/SQLStore/Store.php b/includes/SQLStore/Store.php index 9b4a30b..06036a9 100644 --- a/includes/SQLStore/Store.php +++ b/includes/SQLStore/Store.php @@ -2,7 +2,7 @@ namespace Wikibase\QueryEngine\SQLStore; -use MessageReporter; +use Wikibase\Database\MessageReporter; use Wikibase\Database\QueryInterface; use Wikibase\QueryEngine\QueryStore; use Wikibase\QueryEngine\SQLStore\Engine\DescriptionMatchFinder; diff --git a/tests/integration/SQLStore/Engine/DescriptionMatchFinderIntegrationTest.php b/tests/integration/SQLStore/Engine/DescriptionMatchFinderIntegrationTest.php index c531182..2f02b6a 100644 --- a/tests/integration/SQLStore/Engine/DescriptionMatchFinderIntegrationTest.php +++ b/tests/integration/SQLStore/Engine/DescriptionMatchFinderIntegrationTest.php @@ -6,11 +6,11 @@ use Ask\Language\Description\ValueDescription; use Ask\Language\Option\QueryOptions; use DataValues\NumberValue; -use NullMessageReporter; use Wikibase\Claim; use Wikibase\Database\FieldDefinition; use Wikibase\Database\LazyDBConnectionProvider; use Wikibase\Database\MediaWikiQueryInterface; +use Wikibase\Database\MessageReporter; use Wikibase\Database\MWDB\ExtendedMySQLAbstraction; use Wikibase\Database\TableDefinition; use Wikibase\EntityId; @@ -20,6 +20,7 @@ use Wikibase\QueryEngine\SQLStore\DVHandler\NumberHandler; use Wikibase\QueryEngine\SQLStore\Store; use Wikibase\QueryEngine\SQLStore\StoreConfig; +use Wikibase\Statement; /** * This program is free software; you can redistribute it and/or modify @@ -118,7 +119,7 @@ $item = Item::newEmpty(); $item->setId( 1112 ); - $claim = $item->newClaim( new PropertyValueSnak( 42, new NumberValue( 1337 ) ) ); + $claim = new Statement( new PropertyValueSnak( 42, new NumberValue( 1337 ) ) ); $item->addClaim( $claim ); $this->store->getUpdater()->insertEntity( $item ); @@ -127,7 +128,7 @@ $item = Item::newEmpty(); $item->setId( 1113 ); - $claim = $item->newClaim( new PropertyValueSnak( 43, new NumberValue( 1337 ) ) ); + $claim = new Statement( new PropertyValueSnak( 43, new NumberValue( 1337 ) ) ); $item->addClaim( $claim ); $this->store->getUpdater()->insertEntity( $item ); @@ -136,7 +137,7 @@ $item = Item::newEmpty(); $item->setId( 1114 ); - $claim = $item->newClaim( new PropertyValueSnak( 42, new NumberValue( 72010 ) ) ); + $claim = new Statement( new PropertyValueSnak( 42, new NumberValue( 72010 ) ) ); $item->addClaim( $claim ); $this->store->getUpdater()->insertEntity( $item ); @@ -145,10 +146,10 @@ $item = Item::newEmpty(); $item->setId( 1115 ); - $claim = $item->newClaim( new PropertyValueSnak( 42, new NumberValue( 1337 ) ) ); + $claim = new Statement( new PropertyValueSnak( 42, new NumberValue( 1337 ) ) ); $item->addClaim( $claim ); - $claim = $item->newClaim( new PropertyValueSnak( 43, new NumberValue( 1 ) ) ); + $claim = new Statement( new PropertyValueSnak( 43, new NumberValue( 1 ) ) ); $item->addClaim( $claim ); $this->store->getUpdater()->insertEntity( $item ); @@ -211,5 +212,19 @@ return $argLists; } - } + +class NullMessageReporter implements MessageReporter { + + /** + * @see MessageReporter::reportMessage + * + * @since 1.21 + * + * @param string $message + */ + public function reportMessage( $message ) { + // no-op + } + +} \ No newline at end of file diff --git a/tests/integration/SQLStore/WritingIntegrationTest.php b/tests/integration/SQLStore/WritingIntegrationTest.php index b88a06a..ab18693 100644 --- a/tests/integration/SQLStore/WritingIntegrationTest.php +++ b/tests/integration/SQLStore/WritingIntegrationTest.php @@ -23,6 +23,7 @@ use Wikibase\QueryEngine\SQLStore\DVHandler\StringHandler; use Wikibase\QueryEngine\SQLStore\Store; use Wikibase\QueryEngine\SQLStore\StoreConfig; +use Wikibase\Statement; use Wikibase\Test\ClaimListAccessTest; /** @@ -122,8 +123,7 @@ $item = Item::newEmpty(); $item->setId( 8888 ); - $claim = $item->newClaim( new PropertyValueSnak( 42, new StringValue( 'Awesome' ) ) ); - $item->addClaim( $claim ); + $item->addClaim( new Statement( new PropertyValueSnak( 42, new StringValue( 'Awesome' ) ) ) ); $this->store->getUpdater()->insertEntity( $item ); @@ -164,13 +164,12 @@ $item = Item::newEmpty(); $item->setId( 4444 ); - $claim = $item->newClaim( new PropertyValueSnak( 42, new StringValue( 'Awesome' ) ) ); - $item->addClaim( $claim ); + $item->addClaim( new Statement( new PropertyValueSnak( 42, new StringValue( 'Awesome' ) ) ) ); $this->store->getUpdater()->insertEntity( $item ); $item->setClaims( new Claims( array( - $item->newClaim( new PropertyValueSnak( 42, new StringValue( 'Foo' ) ) ) + new Statement( new PropertyValueSnak( 42, new StringValue( 'Foo' ) ) ) ) ) ); $this->store->getUpdater()->updateEntity( $item ); -- To view, visit https://gerrit.wikimedia.org/r/68362 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8093705d8214924e656262b766a96a4fa980c8fa Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQueryEngine Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits