@@ -109,6 +109,11 @@ public function testConfigEventListenersThrowsExceptionIfEventsNotArray()
109109 ->will ($ this ->returnValue ($ selfCheckListener ));
110110
111111 $ c ->expects ($ this ->at (4 ))
112+ ->method ('has ' )
113+ ->with ('eventListeners ' )
114+ ->willReturn (true );
115+
116+ $ c ->expects ($ this ->at (5 ))
112117 ->method ('get ' )
113118 ->with ('eventListeners ' )
114119 ->will ($ this ->returnValue (new \stdClass ));
@@ -150,6 +155,11 @@ public function testConfigEventListenersThrowsExceptionIfEventsListenersNotArray
150155 ->will ($ this ->returnValue ($ selfCheckListener ));
151156
152157 $ c ->expects ($ this ->at (4 ))
158+ ->method ('has ' )
159+ ->with ('eventListeners ' )
160+ ->willReturn (true );
161+
162+ $ c ->expects ($ this ->at (5 ))
153163 ->method ('get ' )
154164 ->with ('eventListeners ' )
155165 ->will ($ this ->returnValue ([ 'someEvent ' => new \stdClass ]));
@@ -191,6 +201,11 @@ public function testConfigEventListenersThrowsExceptionIfEventsListenerNotCallab
191201 ->will ($ this ->returnValue ($ selfCheckListener ));
192202
193203 $ c ->expects ($ this ->at (4 ))
204+ ->method ('has ' )
205+ ->with ('eventListeners ' )
206+ ->willReturn (true );
207+
208+ $ c ->expects ($ this ->at (5 ))
194209 ->method ('get ' )
195210 ->with ('eventListeners ' )
196211 ->will ($ this ->returnValue ([ 'someEvent ' => [new \stdClass ]]));
@@ -232,11 +247,16 @@ public function testConfigEventListenersThrowsExceptionIfEventsListenerContainer
232247 ->will ($ this ->returnValue ($ selfCheckListener ));
233248
234249 $ c ->expects ($ this ->at (4 ))
250+ ->method ('has ' )
251+ ->with ('eventListeners ' )
252+ ->willReturn (true );
253+
254+ $ c ->expects ($ this ->at (5 ))
235255 ->method ('get ' )
236256 ->with ('eventListeners ' )
237257 ->will ($ this ->returnValue ([ 'someEvent ' => ['nonExistingContainerEntry ' ]]));
238258
239- $ c ->expects ($ this ->once ( ))
259+ $ c ->expects ($ this ->at ( 6 ))
240260 ->method ('has ' )
241261 ->with ('nonExistingContainerEntry ' )
242262 ->will ($ this ->returnValue (false ));
@@ -278,16 +298,21 @@ public function testConfigEventListenersThrowsExceptionIfEventsListenerContainer
278298 ->will ($ this ->returnValue ($ selfCheckListener ));
279299
280300 $ c ->expects ($ this ->at (4 ))
301+ ->method ('has ' )
302+ ->with ('eventListeners ' )
303+ ->willReturn (true );
304+
305+ $ c ->expects ($ this ->at (5 ))
281306 ->method ('get ' )
282307 ->with ('eventListeners ' )
283308 ->will ($ this ->returnValue ([ 'someEvent ' => ['notCallableEntry ' ]]));
284309
285- $ c ->expects ($ this ->once ( ))
310+ $ c ->expects ($ this ->at ( 6 ))
286311 ->method ('has ' )
287312 ->with ('notCallableEntry ' )
288313 ->will ($ this ->returnValue (true ));
289314
290- $ c ->expects ($ this ->at (6 ))
315+ $ c ->expects ($ this ->at (7 ))
291316 ->method ('get ' )
292317 ->with ('notCallableEntry ' )
293318 ->will ($ this ->returnValue (null ));
@@ -332,11 +357,15 @@ public function testConfigEventListenersWithAnonymousFunction()
332357 };
333358
334359 $ c ->expects ($ this ->at (4 ))
360+ ->method ('has ' )
361+ ->with ('eventListeners ' )
362+ ->willReturn (true );
363+
364+ $ c ->expects ($ this ->at (5 ))
335365 ->method ('get ' )
336366 ->with ('eventListeners ' )
337367 ->will ($ this ->returnValue ([ 'someEvent ' => [$ callback ]]));
338368
339-
340369 $ dispatcher = (new EventDispatcherFactory )->__invoke ($ c );
341370 $ this ->assertInstanceOf (EventDispatcher::class, $ dispatcher );
342371 $ this ->assertSame (
@@ -398,22 +427,25 @@ public function testConfigEventListenersWithContainerEntry()
398427 ->with (SelfCheckListener::class)
399428 ->will ($ this ->returnValue ($ selfCheckListener ));
400429
401-
402-
403430 $ c ->expects ($ this ->at (4 ))
431+ ->method ('has ' )
432+ ->with ('eventListeners ' )
433+ ->willReturn (true );
434+
435+ $ c ->expects ($ this ->at (5 ))
404436 ->method ('get ' )
405437 ->with ('eventListeners ' )
406438 ->will ($ this ->returnValue ([ 'someEvent ' => ['containerEntry ' ]]));
407439
408- $ c ->expects ($ this ->once ( ))
440+ $ c ->expects ($ this ->at ( 6 ))
409441 ->method ('has ' )
410442 ->with ('containerEntry ' )
411443 ->will ($ this ->returnValue (true ));
412444
413445 $ callback = function () {
414446 };
415447
416- $ c ->expects ($ this ->at (6 ))
448+ $ c ->expects ($ this ->at (7 ))
417449 ->method ('get ' )
418450 ->with ('containerEntry ' )
419451 ->will ($ this ->returnValue ($ callback ));
0 commit comments