@@ -109,6 +109,11 @@ public function testConfigEventListenersThrowsExceptionIfEventsNotArray()
109
109
->will ($ this ->returnValue ($ selfCheckListener ));
110
110
111
111
$ c ->expects ($ this ->at (4 ))
112
+ ->method ('has ' )
113
+ ->with ('eventListeners ' )
114
+ ->willReturn (true );
115
+
116
+ $ c ->expects ($ this ->at (5 ))
112
117
->method ('get ' )
113
118
->with ('eventListeners ' )
114
119
->will ($ this ->returnValue (new \stdClass ));
@@ -150,6 +155,11 @@ public function testConfigEventListenersThrowsExceptionIfEventsListenersNotArray
150
155
->will ($ this ->returnValue ($ selfCheckListener ));
151
156
152
157
$ c ->expects ($ this ->at (4 ))
158
+ ->method ('has ' )
159
+ ->with ('eventListeners ' )
160
+ ->willReturn (true );
161
+
162
+ $ c ->expects ($ this ->at (5 ))
153
163
->method ('get ' )
154
164
->with ('eventListeners ' )
155
165
->will ($ this ->returnValue ([ 'someEvent ' => new \stdClass ]));
@@ -191,6 +201,11 @@ public function testConfigEventListenersThrowsExceptionIfEventsListenerNotCallab
191
201
->will ($ this ->returnValue ($ selfCheckListener ));
192
202
193
203
$ c ->expects ($ this ->at (4 ))
204
+ ->method ('has ' )
205
+ ->with ('eventListeners ' )
206
+ ->willReturn (true );
207
+
208
+ $ c ->expects ($ this ->at (5 ))
194
209
->method ('get ' )
195
210
->with ('eventListeners ' )
196
211
->will ($ this ->returnValue ([ 'someEvent ' => [new \stdClass ]]));
@@ -232,11 +247,16 @@ public function testConfigEventListenersThrowsExceptionIfEventsListenerContainer
232
247
->will ($ this ->returnValue ($ selfCheckListener ));
233
248
234
249
$ c ->expects ($ this ->at (4 ))
250
+ ->method ('has ' )
251
+ ->with ('eventListeners ' )
252
+ ->willReturn (true );
253
+
254
+ $ c ->expects ($ this ->at (5 ))
235
255
->method ('get ' )
236
256
->with ('eventListeners ' )
237
257
->will ($ this ->returnValue ([ 'someEvent ' => ['nonExistingContainerEntry ' ]]));
238
258
239
- $ c ->expects ($ this ->once ( ))
259
+ $ c ->expects ($ this ->at ( 6 ))
240
260
->method ('has ' )
241
261
->with ('nonExistingContainerEntry ' )
242
262
->will ($ this ->returnValue (false ));
@@ -278,16 +298,21 @@ public function testConfigEventListenersThrowsExceptionIfEventsListenerContainer
278
298
->will ($ this ->returnValue ($ selfCheckListener ));
279
299
280
300
$ c ->expects ($ this ->at (4 ))
301
+ ->method ('has ' )
302
+ ->with ('eventListeners ' )
303
+ ->willReturn (true );
304
+
305
+ $ c ->expects ($ this ->at (5 ))
281
306
->method ('get ' )
282
307
->with ('eventListeners ' )
283
308
->will ($ this ->returnValue ([ 'someEvent ' => ['notCallableEntry ' ]]));
284
309
285
- $ c ->expects ($ this ->once ( ))
310
+ $ c ->expects ($ this ->at ( 6 ))
286
311
->method ('has ' )
287
312
->with ('notCallableEntry ' )
288
313
->will ($ this ->returnValue (true ));
289
314
290
- $ c ->expects ($ this ->at (6 ))
315
+ $ c ->expects ($ this ->at (7 ))
291
316
->method ('get ' )
292
317
->with ('notCallableEntry ' )
293
318
->will ($ this ->returnValue (null ));
@@ -332,11 +357,15 @@ public function testConfigEventListenersWithAnonymousFunction()
332
357
};
333
358
334
359
$ c ->expects ($ this ->at (4 ))
360
+ ->method ('has ' )
361
+ ->with ('eventListeners ' )
362
+ ->willReturn (true );
363
+
364
+ $ c ->expects ($ this ->at (5 ))
335
365
->method ('get ' )
336
366
->with ('eventListeners ' )
337
367
->will ($ this ->returnValue ([ 'someEvent ' => [$ callback ]]));
338
368
339
-
340
369
$ dispatcher = (new EventDispatcherFactory )->__invoke ($ c );
341
370
$ this ->assertInstanceOf (EventDispatcher::class, $ dispatcher );
342
371
$ this ->assertSame (
@@ -398,22 +427,25 @@ public function testConfigEventListenersWithContainerEntry()
398
427
->with (SelfCheckListener::class)
399
428
->will ($ this ->returnValue ($ selfCheckListener ));
400
429
401
-
402
-
403
430
$ c ->expects ($ this ->at (4 ))
431
+ ->method ('has ' )
432
+ ->with ('eventListeners ' )
433
+ ->willReturn (true );
434
+
435
+ $ c ->expects ($ this ->at (5 ))
404
436
->method ('get ' )
405
437
->with ('eventListeners ' )
406
438
->will ($ this ->returnValue ([ 'someEvent ' => ['containerEntry ' ]]));
407
439
408
- $ c ->expects ($ this ->once ( ))
440
+ $ c ->expects ($ this ->at ( 6 ))
409
441
->method ('has ' )
410
442
->with ('containerEntry ' )
411
443
->will ($ this ->returnValue (true ));
412
444
413
445
$ callback = function () {
414
446
};
415
447
416
- $ c ->expects ($ this ->at (6 ))
448
+ $ c ->expects ($ this ->at (7 ))
417
449
->method ('get ' )
418
450
->with ('containerEntry ' )
419
451
->will ($ this ->returnValue ($ callback ));
0 commit comments