Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/68366


Change subject: Claims need to have their GUID set
......................................................................

Claims need to have their GUID set

Change-Id: If3e65cd9acf15fbc6381ab3227d0385f5b633c99
---
M tests/integration/SQLStore/Engine/DescriptionMatchFinderIntegrationTest.php
M tests/integration/SQLStore/WritingIntegrationTest.php
2 files changed, 15 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQueryEngine 
refs/changes/66/68366/1

diff --git 
a/tests/integration/SQLStore/Engine/DescriptionMatchFinderIntegrationTest.php 
b/tests/integration/SQLStore/Engine/DescriptionMatchFinderIntegrationTest.php
index 3a225f6..5ccbcd7 100644
--- 
a/tests/integration/SQLStore/Engine/DescriptionMatchFinderIntegrationTest.php
+++ 
b/tests/integration/SQLStore/Engine/DescriptionMatchFinderIntegrationTest.php
@@ -119,6 +119,7 @@
                $item->setId( 1112 );
 
                $claim = new Statement( new PropertyValueSnak( 42, new 
NumberValue( 1337 ) ) );
+               $claim->setGuid( 'claim0' );
                $item->addClaim( $claim );
 
                $this->store->getUpdater()->insertEntity( $item );
@@ -128,6 +129,7 @@
                $item->setId( 1113 );
 
                $claim = new Statement( new PropertyValueSnak( 43, new 
NumberValue( 1337 ) ) );
+               $claim->setGuid( 'claim1' );
                $item->addClaim( $claim );
 
                $this->store->getUpdater()->insertEntity( $item );
@@ -137,6 +139,7 @@
                $item->setId( 1114 );
 
                $claim = new Statement( new PropertyValueSnak( 42, new 
NumberValue( 72010 ) ) );
+               $claim->setGuid( 'claim2' );
                $item->addClaim( $claim );
 
                $this->store->getUpdater()->insertEntity( $item );
@@ -146,9 +149,11 @@
                $item->setId( 1115 );
 
                $claim = new Statement( new PropertyValueSnak( 42, new 
NumberValue( 1337 ) ) );
+               $claim->setGuid( 'claim3' );
                $item->addClaim( $claim );
 
                $claim = new Statement( new PropertyValueSnak( 43, new 
NumberValue( 1 ) ) );
+               $claim->setGuid( 'claim4' );
                $item->addClaim( $claim );
 
                $this->store->getUpdater()->insertEntity( $item );
diff --git a/tests/integration/SQLStore/WritingIntegrationTest.php 
b/tests/integration/SQLStore/WritingIntegrationTest.php
index 39cecf8..5052eb2 100644
--- a/tests/integration/SQLStore/WritingIntegrationTest.php
+++ b/tests/integration/SQLStore/WritingIntegrationTest.php
@@ -120,7 +120,9 @@
                $item = Item::newEmpty();
                $item->setId( 8888 );
 
-               $item->addClaim( new Statement( new PropertyValueSnak( 42, new 
StringValue( 'Awesome' ) ) ) );
+               $claim = new Statement( new PropertyValueSnak( 42, new 
StringValue( 'Awesome' ) ) );
+               $claim->setGuid( 'a claim' );
+               $item->addClaim( $claim );
 
                $this->store->getUpdater()->insertEntity( $item );
 
@@ -161,12 +163,17 @@
                $item = Item::newEmpty();
                $item->setId( 4444 );
 
-               $item->addClaim( new Statement( new PropertyValueSnak( 42, new 
StringValue( 'Awesome' ) ) ) );
+               $claim = new Statement( new PropertyValueSnak( 42, new 
StringValue( 'Awesome' ) ) );
+               $claim->setGuid( 'foo claim' );
+               $item->addClaim( $claim );
 
                $this->store->getUpdater()->insertEntity( $item );
 
+               $claim = new Statement( new PropertyValueSnak( 42, new 
StringValue( 'Foo' ) ) );
+               $claim->setGuid( 'bar claim' );
+
                $item->setClaims( new Claims( array(
-                       new Statement( new PropertyValueSnak( 42, new 
StringValue( 'Foo' ) ) )
+                       $claim
                ) ) );
 
                $this->store->getUpdater()->updateEntity( $item );

-- 
To view, visit https://gerrit.wikimedia.org/r/68366
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3e65cd9acf15fbc6381ab3227d0385f5b633c99
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

Reply via email to