@@ -210,27 +210,21 @@ public function testAddClaim() {
210210 $ this ->assertNotNull ( $ claims ->getClaimWithGuid ( $ claim1 ->getGuid () ) );
211211 $ this ->assertNotNull ( $ claims ->getClaimWithGuid ( $ claim2 ->getGuid () ) );
212212
213- // Insert claim at the beginning:
214- $ claim3 = $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P17 ' ) ) );
215- $ claims ->addClaim ( $ claim3 , 0 );
216-
217- // Insert claim at another index:
218- $ claim4 = $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P18 ' ) ) );
219- $ claims ->addClaim ( $ claim4 , 1 );
220-
221- // Insert claim with an index out of bounds:
222- $ claim5 = $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P19 ' ) ) );
223- $ claims ->addClaim ( $ claim5 , 99999 );
224-
225213 $ this ->assertSame ( array (
226- 'TEST$CLAIM-3 ' => $ claim3 ,
227- 'TEST$CLAIM-4 ' => $ claim4 ,
228214 'TEST$CLAIM-1 ' => $ claim1 ,
229215 'TEST$CLAIM-2 ' => $ claim2 ,
230- 'TEST$CLAIM-5 ' => $ claim5 ,
231216 ), $ claims ->getArrayCopy () );
232217 }
233218
219+ /**
220+ * @expectedException InvalidArgumentException
221+ */
222+ public function testAddClaimWithIndexFails () {
223+ $ claims = new Claims ();
224+ $ claim = new Claim ( new PropertyNoValueSnak ( 42 ) );
225+ $ claims ->addClaim ( $ claim , 0 );
226+ }
227+
234228 public function testAppend () {
235229 $ claims = new Claims ();
236230 $ claim1 = $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P15 ' ) ) );
0 commit comments