@@ -205,17 +205,29 @@ public function testBadInterfaceForAutomaticInstanceofIsOk()
205
205
public function testProcessForAutoconfiguredCalls ()
206
206
{
207
207
$ container = new ContainerBuilder ();
208
- $ container ->registerForAutoconfiguration (parent ::class)->addMethodCall ('setLogger ' );
209
208
210
- $ def = $ container ->register ('foo ' , self ::class)->setAutoconfigured (true );
211
- $ this ->assertFalse ($ def ->hasMethodCall ('setLogger ' ), 'Definition shouldn \'t have method call yet. ' );
209
+ $ expected = array (
210
+ array ('setFoo ' , array (
211
+ 'plain_value ' ,
212
+ '%some_parameter% '
213
+ )),
214
+ array ('callBar ' , array ()),
215
+ array ('isBaz ' , array ()),
216
+ );
212
217
213
- (new ResolveInstanceofConditionalsPass ())->process ($ container );
218
+ $ container ->registerForAutoconfiguration (parent ::class)->addMethodCall ('setFoo ' , $ expected [0 ][1 ]);
219
+ $ container ->registerForAutoconfiguration (self ::class)->addMethodCall ('callBar ' );
214
220
215
- $ this ->assertTrue (
216
- $ container ->findDefinition ('foo ' )->hasMethodCall ('setLogger ' ),
217
- 'Definition should have "setLogger" method call. '
221
+ $ def = $ container ->register ('foo ' , self ::class)->setAutoconfigured (true )->addMethodCall ('isBaz ' );
222
+ $ this ->assertEquals (
223
+ array (array ('isBaz ' , array ())),
224
+ $ def ->getMethodCalls (),
225
+ 'Definition shouldn \'t have only one method call. '
218
226
);
227
+
228
+ (new ResolveInstanceofConditionalsPass ())->process ($ container );
229
+
230
+ $ this ->assertEquals ($ expected , $ container ->findDefinition ('foo ' )->getMethodCalls ());
219
231
}
220
232
221
233
/**
0 commit comments