File tree 3 files changed +4
-4
lines changed
src/Symfony/Component/Messenger/Tests
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ public function testHandleWithException()
117
117
$ message = new DummyMessage ('dummy message ' );
118
118
119
119
$ bus = $ this ->getMockBuilder (MessageBusInterface::class)->getMock ();
120
- $ bus ->method ('dispatch ' )->with ($ message )->will ( $ this -> throwException ( new \RuntimeException ('foo ' ) ));
120
+ $ bus ->method ('dispatch ' )->with ($ message )->willThrowException ( new \RuntimeException ('foo ' ));
121
121
$ bus = new TraceableMessageBus ($ bus );
122
122
123
123
$ collector = new MessengerDataCollector ();
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public function testItCallsNextMiddlewareAndReturnsItsResult()
32
32
public function testItCatchesTheNoHandlerException ()
33
33
{
34
34
$ next = $ this ->createPartialMock (\stdClass::class, array ('__invoke ' ));
35
- $ next ->expects ($ this ->once ())->method ('__invoke ' )->will ( $ this -> throwException ( new NoHandlerForMessageException () ));
35
+ $ next ->expects ($ this ->once ())->method ('__invoke ' )->willThrowException ( new NoHandlerForMessageException ());
36
36
37
37
$ middleware = new AllowNoHandlerMiddleware ();
38
38
@@ -46,7 +46,7 @@ public function testItCatchesTheNoHandlerException()
46
46
public function testItDoesNotCatchOtherExceptions ()
47
47
{
48
48
$ next = $ this ->createPartialMock (\stdClass::class, array ('__invoke ' ));
49
- $ next ->expects ($ this ->once ())->method ('__invoke ' )->will ( $ this -> throwException ( new \RuntimeException ('Something went wrong. ' ) ));
49
+ $ next ->expects ($ this ->once ())->method ('__invoke ' )->willThrowException ( new \RuntimeException ('Something went wrong. ' ));
50
50
51
51
$ middleware = new AllowNoHandlerMiddleware ();
52
52
$ middleware ->handle (new DummyMessage ('Hey ' ), $ next );
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public function testItTracesExceptions()
59
59
$ message = new DummyMessage ('Hello ' );
60
60
61
61
$ bus = $ this ->getMockBuilder (MessageBusInterface::class)->getMock ();
62
- $ bus ->expects ($ this ->once ())->method ('dispatch ' )->with ($ message )->will ( $ this -> throwException ( $ exception = new \RuntimeException ('Meh. ' ) ));
62
+ $ bus ->expects ($ this ->once ())->method ('dispatch ' )->with ($ message )->willThrowException ( $ exception = new \RuntimeException ('Meh. ' ));
63
63
64
64
$ traceableBus = new TraceableMessageBus ($ bus );
65
65
You can’t perform that action at this time.
0 commit comments