use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage;
class HandleMessageMiddlewareTest extends MiddlewareTestCase
{ public function testItCallsTheHandlerAndNextMiddleware() { $message =
new DummyMessage('Hey'
);
$envelope =
new Envelope($message);
$handler =
$this->
createPartialMock(HandleMessageMiddlewareTestCallable::
class,
['__invoke'
]);
$middleware =
new HandleMessageMiddleware(new HandlersLocator([ DummyMessage::
class => [$handler],
]));
$handler->
expects($this->
once())->
method('__invoke'
)->
with($message);
$middleware->
handle($envelope,
$this->
getStackMock());
} /**
* @dataProvider itAddsHandledStampsProvider
*/