Skip to content

Commit db471eb

Browse files
committed
Extends the required methods to be compatible with DataModel 5 and 6
1 parent e4f2a40 commit db471eb

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

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)