@@ -87,10 +87,10 @@ public function testGetRouteCollectionForRequest(): void
87
87
->willReturn ($ candidates )
88
88
;
89
89
90
- $ objects = [
90
+ $ objects = new ArrayCollection ( [
91
91
new Route ('/my ' ),
92
92
$ this ,
93
- ];
93
+ ]) ;
94
94
95
95
$ this ->dmMock
96
96
->expects ($ this ->once ())
@@ -327,28 +327,9 @@ public function testGetRoutesByNames(): void
327
327
;
328
328
329
329
$ this ->candidatesMock
330
- ->expects ($ this ->at (0 ))
331
- ->method ('isCandidate ' )
332
- ->with ('/cms/routes/test-route ' )
333
- ->willReturn (true )
334
- ;
335
- $ this ->candidatesMock
336
- ->expects ($ this ->at (1 ))
337
- ->method ('isCandidate ' )
338
- ->with ('/cms/simple/other-route ' )
339
- ->willReturn (true )
340
- ;
341
- $ this ->candidatesMock
342
- ->expects ($ this ->at (2 ))
343
330
->method ('isCandidate ' )
344
- ->with ('/cms/routes/not-a-route ' )
345
- ->willReturn (true )
346
- ;
347
- $ this ->candidatesMock
348
- ->expects ($ this ->at (3 ))
349
- ->method ('isCandidate ' )
350
- ->with ('/outside/prefix ' )
351
- ->willReturn (false )
331
+ ->withConsecutive (['/cms/routes/test-route ' ], ['/cms/simple/other-route ' ], ['/cms/routes/not-a-route ' ], ['/outside/prefix ' ])
332
+ ->willReturnOnConsecutiveCalls (true , true , true , false )
352
333
;
353
334
354
335
$ paths [] = '/outside/prefix ' ;
@@ -374,21 +355,8 @@ public function testGetRoutesByNamesNotCandidates(): void
374
355
;
375
356
376
357
$ this ->candidatesMock
377
- ->expects ($ this ->at (0 ))
378
358
->method ('isCandidate ' )
379
- ->with ('/cms/routes/test-route ' )
380
- ->willReturn (false )
381
- ;
382
- $ this ->candidatesMock
383
- ->expects ($ this ->at (1 ))
384
- ->method ('isCandidate ' )
385
- ->with ('/cms/simple/other-route ' )
386
- ->willReturn (false )
387
- ;
388
- $ this ->candidatesMock
389
- ->expects ($ this ->at (2 ))
390
- ->method ('isCandidate ' )
391
- ->with ('/cms/routes/not-a-route ' )
359
+ ->with (['/cms/routes/test-route ' ], ['/cms/simple/other-route ' ], ['/cms/routes/not-a-route ' ])
392
360
->willReturn (false )
393
361
;
394
362
@@ -429,29 +397,15 @@ public function testGetRoutesByNamesUuid(): void
429
397
->willReturn ($ uow )
430
398
;
431
399
$ uow
432
- ->expects ($ this ->at (0 ))
433
400
->method ('getDocumentId ' )
434
- ->with ($ route1 )
435
- ->willReturn ('/cms/routes/test-route ' )
436
- ;
437
- $ uow
438
- ->expects ($ this ->at (1 ))
439
- ->method ('getDocumentId ' )
440
- ->with ($ route2 )
441
- ->willReturn ('/cms/routes/other-route ' )
401
+ ->withConsecutive ([$ route1 ], [$ route2 ])
402
+ ->willReturnOnConsecutiveCalls ('/cms/routes/test-route ' , '/cms/routes/other-route ' )
442
403
;
443
404
444
405
$ this ->candidatesMock
445
- ->expects ($ this ->at (0 ))
446
- ->method ('isCandidate ' )
447
- ->with ('/cms/routes/test-route ' )
448
- ->willReturn (true )
449
- ;
450
- $ this ->candidatesMock
451
- ->expects ($ this ->at (1 ))
452
406
->method ('isCandidate ' )
453
- ->with ( '/cms/routes/other-route ' )
454
- ->willReturn ( false )
407
+ ->withConsecutive ([ '/cms/routes/test-route ' ], [ ' /cms/routes/ other-route '] )
408
+ ->willReturnOnConsecutiveCalls ( true , false )
455
409
;
456
410
457
411
$ routeProvider = new RouteProvider ($ this ->managerRegistryMock , $ this ->candidatesMock );
@@ -469,6 +423,7 @@ private function doRouteDump($limit): void
469
423
->with (Route::class, 'd ' )
470
424
;
471
425
426
+
472
427
$ query = $ this ->createMock (Query::class);
473
428
$ query
474
429
->expects ($ this ->once ())
0 commit comments