$second =
new HandlerDescriptor($secondHandler,
['from_transport' => 'transportName', 'alias' => 'three'
]),
],
]);
$first->
getName();
$second->
getName();
$this->
assertEquals([ $first,
$second,
],
iterator_to_array($locator->
getHandlers( new Envelope(new DummyMessage('Body'
),
[new ReceivedStamp('transportName'
)]) )));
} public function testItReturnsOnlyHandlersMatchingMessageNamespace() { $firstHandler =
$this->
createPartialMock(HandlersLocatorTestCallable::
class,
['__invoke'
]);
$secondHandler =
$this->
createPartialMock(HandlersLocatorTestCallable::
class,
['__invoke'
]);
$locator =
new HandlersLocator([ str_replace('DummyMessage', '*', DummyMessage::
class) =>
[ $first =
new HandlerDescriptor($firstHandler,
['alias' => 'one'
]),
],