File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -342,6 +342,15 @@ public function getStatements() {
342342 return $ this ->statements ;
343343 }
344344
345+ /**
346+ * @since 1.0
347+ *
348+ * @param StatementList $statements
349+ */
350+ public function setStatements ( StatementList $ statements ) {
351+ $ this ->statements = $ statements ;
352+ }
353+
345354 /**
346355 * @deprecated since 1.0, use getStatements instead
347356 *
@@ -352,7 +361,7 @@ public function getClaims() {
352361 }
353362
354363 /**
355- * @deprecated since 1.0, use getStatements instead
364+ * @deprecated since 1.0, use setStatements instead
356365 *
357366 * @param Claims $claims
358367 */
Original file line number Diff line number Diff line change @@ -695,7 +695,7 @@ public function testNewClaimReturnsStatementWithProvidedMainSnak() {
695695 $ this ->assertEquals ( $ snak , $ statement ->getMainSnak () );
696696 }
697697
698- public function testSetStatements () {
698+ public function testSetClaims () {
699699 $ item = Item::newEmpty ();
700700
701701 $ statement0 = new Statement ( new PropertyNoValueSnak ( 42 ) );
@@ -805,4 +805,12 @@ public function testCanConstructWithStatementList() {
805805 );
806806 }
807807
808+ public function testSetStatements () {
809+ $ item = Item::newEmpty ();
810+ $ item ->getStatements ()->addNewStatement ( new PropertyNoValueSnak ( 42 ) );
811+
812+ $ item ->setStatements ( new StatementList () );
813+ $ this ->assertEquals ( new StatementList (), $ item ->getStatements () );
814+ }
815+
808816}
You can’t perform that action at this time.
0 commit comments