File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -392,7 +392,6 @@ public function removeMethodCall($method)
392
392
foreach ($ this ->calls as $ i => $ call ) {
393
393
if ($ call [0 ] === $ method ) {
394
394
unset($ this ->calls [$ i ]);
395
- break ;
396
395
}
397
396
}
398
397
Original file line number Diff line number Diff line change @@ -425,4 +425,20 @@ public function testAddError()
425
425
$ def ->addError ('Second error ' );
426
426
$ this ->assertSame (['First error ' , 'Second error ' ], $ def ->getErrors ());
427
427
}
428
+
429
+ public function testMultipleMethodCalls ()
430
+ {
431
+ $ def = new Definition ('stdClass ' );
432
+
433
+ $ def ->addMethodCall ('configure ' , ['arg1 ' ]);
434
+ $ this ->assertTrue ($ def ->hasMethodCall ('configure ' ));
435
+ $ this ->assertCount (1 , $ def ->getMethodCalls ());
436
+
437
+ $ def ->addMethodCall ('configure ' , ['arg2 ' ]);
438
+ $ this ->assertTrue ($ def ->hasMethodCall ('configure ' ));
439
+ $ this ->assertCount (2 , $ def ->getMethodCalls ());
440
+
441
+ $ def ->removeMethodCall ('configure ' );
442
+ $ this ->assertFalse ($ def ->hasMethodCall ('configure ' ));
443
+ }
428
444
}
You can’t perform that action at this time.
0 commit comments