@@ -47,13 +47,15 @@ public function testLocaleIsSetInOnKernelRequest()
4747 public function testDefaultLocaleIsUsedOnExceptionsInOnKernelRequest ()
4848 {
4949 $ this ->localeAwareService
50- ->expects ($ this ->at ( 0 ))
50+ ->expects ($ this ->exactly ( 2 ))
5151 ->method ('setLocale ' )
52- ->will ($ this ->throwException (new \InvalidArgumentException ()));
53- $ this ->localeAwareService
54- ->expects ($ this ->at (1 ))
55- ->method ('setLocale ' )
56- ->with ($ this ->equalTo ('en ' ));
52+ ->withConsecutive (
53+ [$ this ->anything ()],
54+ ['en ' ]
55+ )
56+ ->willReturnOnConsecutiveCalls (
57+ $ this ->throwException (new \InvalidArgumentException ())
58+ );
5759
5860 $ event = new RequestEvent ($ this ->createHttpKernel (), $ this ->createRequest ('fr ' ), HttpKernelInterface::MASTER_REQUEST );
5961 $ this ->listener ->onKernelRequest ($ event );
@@ -89,13 +91,15 @@ public function testLocaleIsSetToDefaultOnKernelFinishRequestWhenParentRequestDo
8991 public function testDefaultLocaleIsUsedOnExceptionsInOnKernelFinishRequest ()
9092 {
9193 $ this ->localeAwareService
92- ->expects ($ this ->at ( 0 ))
94+ ->expects ($ this ->exactly ( 2 ))
9395 ->method ('setLocale ' )
94- ->will ($ this ->throwException (new \InvalidArgumentException ()));
95- $ this ->localeAwareService
96- ->expects ($ this ->at (1 ))
97- ->method ('setLocale ' )
98- ->with ($ this ->equalTo ('en ' ));
96+ ->withConsecutive (
97+ [$ this ->anything ()],
98+ ['en ' ]
99+ )
100+ ->willReturnOnConsecutiveCalls (
101+ $ this ->throwException (new \InvalidArgumentException ())
102+ );
99103
100104 $ this ->requestStack ->push ($ this ->createRequest ('fr ' ));
101105 $ this ->requestStack ->push ($ subRequest = $ this ->createRequest ('de ' ));
0 commit comments