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)
392392 foreach ($ this ->calls as $ i => $ call ) {
393393 if ($ call [0 ] === $ method ) {
394394 unset($ this ->calls [$ i ]);
395- break ;
396395 }
397396 }
398397
Original file line number Diff line number Diff line change @@ -425,4 +425,20 @@ public function testAddError()
425425 $ def ->addError ('Second error ' );
426426 $ this ->assertSame (['First error ' , 'Second error ' ], $ def ->getErrors ());
427427 }
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+ }
428444}
You can’t perform that action at this time.
0 commit comments