We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 24023c6 commit 6f6ff35Copy full SHA for 6f6ff35
2 files changed
src/Entity/Item.php
@@ -233,7 +233,7 @@ public function isEmpty() {
233
public function clear() {
234
$this->fingerprint = Fingerprint::newEmpty();
235
$this->siteLinks = new SiteLinkList();
236
- $this->statements = array();
+ $this->statements = new StatementList();
237
}
238
239
/**
tests/unit/Entity/ItemTest.php
@@ -813,4 +813,11 @@ public function testSetStatements() {
813
$this->assertEquals( new StatementList(), $item->getStatements() );
814
815
816
+ public function testGetStatementsReturnsCorrectTypeAfterClear() {
817
+ $item = Item::newEmpty();
818
+ $item->clear();
819
+
820
+ $this->assertEquals( new StatementList(), $item->getStatements() );
821
+ }
822
823
0 commit comments