This commit is contained in:
Fabien Potencier 2018-12-23 15:08:41 +01:00
parent 729edde312
commit 842c5943dc
3 changed files with 4 additions and 4 deletions

View File

@ -117,7 +117,7 @@ DUMP
$message = new DummyMessage('dummy message');
$bus = $this->getMockBuilder(MessageBusInterface::class)->getMock();
$bus->method('dispatch')->with($message)->will($this->throwException(new \RuntimeException('foo')));
$bus->method('dispatch')->with($message)->willThrowException(new \RuntimeException('foo'));
$bus = new TraceableMessageBus($bus);
$collector = new MessengerDataCollector();

View File

@ -32,7 +32,7 @@ class AllowNoHandlerMiddlewareTest extends TestCase
public function testItCatchesTheNoHandlerException()
{
$next = $this->createPartialMock(\stdClass::class, array('__invoke'));
$next->expects($this->once())->method('__invoke')->will($this->throwException(new NoHandlerForMessageException()));
$next->expects($this->once())->method('__invoke')->willThrowException(new NoHandlerForMessageException());
$middleware = new AllowNoHandlerMiddleware();
@ -46,7 +46,7 @@ class AllowNoHandlerMiddlewareTest extends TestCase
public function testItDoesNotCatchOtherExceptions()
{
$next = $this->createPartialMock(\stdClass::class, array('__invoke'));
$next->expects($this->once())->method('__invoke')->will($this->throwException(new \RuntimeException('Something went wrong.')));
$next->expects($this->once())->method('__invoke')->willThrowException(new \RuntimeException('Something went wrong.'));
$middleware = new AllowNoHandlerMiddleware();
$middleware->handle(new DummyMessage('Hey'), $next);

View File

@ -59,7 +59,7 @@ class TraceableMessageBusTest extends TestCase
$message = new DummyMessage('Hello');
$bus = $this->getMockBuilder(MessageBusInterface::class)->getMock();
$bus->expects($this->once())->method('dispatch')->with($message)->will($this->throwException($exception = new \RuntimeException('Meh.')));
$bus->expects($this->once())->method('dispatch')->with($message)->willThrowException($exception = new \RuntimeException('Meh.'));
$traceableBus = new TraceableMessageBus($bus);