Skip to content

Commit af98d24

Browse files
committed
Merge pull request #18 from ProjetPP/wb-datamodel-5&6
Adds supports for WikibaseDataModel 5 and 6
2 parents fa94541 + d289589 commit af98d24

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
],
1717
"require": {
1818
"php": ">=5.5.0",
19-
"wikibase/data-model": "~4.3",
19+
"wikibase/data-model": "~4.3|~5.0|~6.0",
2020
"wikibase/data-model-services": "~3.2",
2121
"wikibase/data-model-serialization": "~2.0",
2222
"data-values/data-values": "~1.0",

src/DataModel/SerializedEntity.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,18 @@ public function isEmpty() {
7777
public function getSerialization() {
7878
return $this->serialization;
7979
}
80+
81+
/**
82+
* @see Comparable::equals
83+
*/
84+
public function equals( $target ) {
85+
$target instanceof SerializedEntity && $this->serialization == $target->serialization;
86+
}
87+
88+
/**
89+
* @see EntityDocument::copy
90+
*/
91+
public function copy() {
92+
return $this; // Read only entity
93+
}
8094
}

tests/integration/ApiTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public function testApiStore() {
3232
$this->assertEquals( 2, count( $results ) );
3333

3434
$this->assertEquals(
35-
[ new ItemId( 'Q42' ) ],
36-
$store->getItemIdForTermLookup()->getItemIdsForTerm( new Term( 'en', 'Douglas Noël Adams' ) )
35+
[ new ItemId( 'Q260' ) ],
36+
$store->getItemIdForTermLookup()->getItemIdsForTerm( new Term( 'fr', 'Jean-François Champollion' ) )
3737
);
3838

3939
$this->assertEquals(

0 commit comments

Comments
 (0)