@@ -229,20 +229,21 @@ public function testPathExceptionContinueOnError()
229229 $ data = array ('abc ' => $ actualValue );
230230 $ patch = new JsonPatch ();
231231
232- $ operation1 = new JsonPatch \Test ('/abc ' , 'def ' );
233- $ patch ->op ($ operation1 );
232+ $ operation0 = new JsonPatch \Test ('/abc ' , 'def ' );
233+ $ patch ->op ($ operation0 );
234234
235- $ operation2 = new JsonPatch \Move ('/target ' , '/source ' );
236- $ patch ->op ($ operation2 );
235+ $ operation1 = new JsonPatch \Move ('/target ' , '/source ' );
236+ $ patch ->op ($ operation1 );
237237
238238 $ errors = $ patch ->apply ($ data , false );
239239
240240 $ this ->assertInstanceOf (PatchTestOperationFailedException::class, $ errors [0 ]);
241- $ this ->assertSame ($ operation1 , $ errors [0 ]->getOperation ());
241+ $ this ->assertSame ($ operation0 , $ errors [0 ]->getOperation ());
242242
243243 $ this ->assertInstanceOf (PathException::class, $ errors [1 ]);
244- $ this ->assertSame ($ operation2 , $ errors [1 ]->getOperation ());
244+ $ this ->assertSame ($ operation1 , $ errors [1 ]->getOperation ());
245245 $ this ->assertSame ('from ' , $ errors [1 ]->getField ());
246+ $ this ->assertEquals (1 , $ errors [1 ]->getOpIndex ());
246247 }
247248
248249 public function pathExceptionProvider () {
@@ -305,6 +306,7 @@ public function testPathException(OpPath $operation, $expectedMessage, $expected
305306 $ this ->assertInstanceOf (PathException::class, $ ex );
306307 $ this ->assertEquals ($ expectedMessage , $ ex ->getMessage ());
307308 $ this ->assertEquals ($ expectedField , $ ex ->getField ());
309+ $ this ->assertEquals (0 , $ ex ->getOpIndex ()); // There is only one operation
308310 }
309311 }
310312}
0 commit comments