@@ -237,38 +237,22 @@ public function testAddClaim() {
237237 // Insert claim at the beginning:
238238 $ claim3 = $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P17 ' ) ) );
239239 $ claims ->addClaim ( $ claim3 , 0 );
240- $ this ->assertEquals ( 0 , $ claims ->indexOf ( $ claim3 ), 'Inserting claim at the beginning failed ' );
241240
242241 // Insert claim at another index:
243242 $ claim4 = $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P18 ' ) ) );
244243 $ claims ->addClaim ( $ claim4 , 1 );
245- $ this ->assertEquals ( 1 , $ claims ->indexOf ( $ claim4 ), 'Inserting claim at index 1 failed ' );
246244
247245 // Insert claim with an index out of bounds:
248246 $ claim5 = $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P19 ' ) ) );
249247 $ claims ->addClaim ( $ claim5 , 99999 );
250- $ this ->assertEquals ( 4 , $ claims ->indexOf ( $ claim5 ), 'Appending claim by specifying an index out of bounds failed ' );
251- }
252-
253- public function testIndexOf () {
254- $ claims = new Claims ();
255- $ claimArray = array (
256- $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P1 ' ) ) ),
257- $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P2 ' ) ) ),
258- $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P3 ' ) ) ),
259- );
260- $ excludedClaim = $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P99 ' ) ) );
261248
262- foreach ( $ claimArray as $ claim ) {
263- $ claims ->addClaim ( $ claim );
264- }
265-
266- $ this ->assertFalse ( $ claims ->indexOf ( $ excludedClaim ) );
267-
268- $ i = 0 ;
269- foreach ( $ claimArray as $ claim ) {
270- $ this ->assertEquals ( $ i ++, $ claims ->indexOf ( $ claim ) );
271- }
249+ $ this ->assertSame ( array (
250+ 'TEST$CLAIM-3 ' => $ claim3 ,
251+ 'TEST$CLAIM-4 ' => $ claim4 ,
252+ 'TEST$CLAIM-1 ' => $ claim1 ,
253+ 'TEST$CLAIM-2 ' => $ claim2 ,
254+ 'TEST$CLAIM-5 ' => $ claim5 ,
255+ ), $ claims ->getArrayCopy () );
272256 }
273257
274258 public function testAppend () {
0 commit comments