Skip to content

Commit

Permalink
Fix cocnstruction of Statement
Browse files Browse the repository at this point in the history
  • Loading branch information
tobijat committed Oct 17, 2014
1 parent 60ccf6a commit 55f73fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -5,6 +5,7 @@
use LoadBalancerSingle;
use InvalidArgumentException;
use MediaWikiTestCase;
use Wikibase\DataModel\Claim\Claim;
use Wikibase\DataModel\Entity\Item;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Entity\PropertyId;
Expand Down Expand Up @@ -69,7 +70,7 @@ public function testSuggestByPropertyIds() {
public function testSuggestByItem() {
$item = Item::newEmpty();
$item->setId( new ItemId( 'Q42' ) );
$statement = new Statement( new PropertySomeValueSnak( new PropertyId( 'P1' ) ) );
$statement = new Statement( new Claim( new PropertySomeValueSnak( new PropertyId( 'P1' ) ) ) );
$statement->setGuid( 'claim0' );
$item->addClaim( $statement );

Expand Down
3 changes: 2 additions & 1 deletion tests/phpunit/PropertySuggester/SuggestionGeneratorTest.php
Expand Up @@ -5,6 +5,7 @@
use MediaWikiTestCase;
use PropertySuggester\Suggesters\SuggesterEngine;
use PropertySuggester\Suggesters\Suggestion;
use Wikibase\DataModel\Claim\Claim;
use Wikibase\DataModel\Entity\PropertyId;
use Wikibase\DataModel\Entity\Item;
use Wikibase\DataModel\Snak\PropertySomeValueSnak;
Expand Down Expand Up @@ -104,7 +105,7 @@ public function testGenerateSuggestionsWithPropertyList() {
public function testGenerateSuggestionsWithItem() {
$item = Item::newEmpty();
$item->setId( new ItemId( 'Q42' ) );
$statement = new Statement( new PropertySomeValueSnak( new PropertyId( 'P12' ) ) );
$statement = new Statement( new Claim( new PropertySomeValueSnak( new PropertyId( 'P12' ) ) ) );
$statement->setGuid( 'claim0' ); // otherwise "InvalidArgumentException: Can't add a Claim without a GUID."
$item->addClaim( $statement );

Expand Down

0 comments on commit 55f73fb

Please sign in to comment.