use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Header\Headers;
use Symfony\Component\Mime\Message;
class MessengerTransportListenerTest extends TestCase
{ public function testNoMessengerTransportStampsByDefault() { $l =
new MessengerTransportListener();
$envelope =
new Envelope(new Address('sender@example.com'
),
[new Address('recipient@example.com'
)]);
$message =
new Message(new Headers());
$event =
new MessageEvent($message,
$envelope, 'smtp', true
);
$l->
onMessage($event);
$this->
assertEmpty($event->
getStamps());
} public function testMessengerTransportStampViaHeader() { $l =
new MessengerTransportListener();
$envelope =
new Envelope(new Address('sender@example.com'
),
[new Address('recipient@example.com'
)]);
$headers =
(new Headers())->
addTextHeader('X-Bus-Transport', 'async'
);
$message =
new Message($headers);
$event =
new MessageEvent($message,
$envelope, 'smtp', true
);