/**
  * Action on pre send event of mailer transport.
  *
  * @param FilterPreSendEvent $event The event
  */
 public function onPreSend(FilterPreSendEvent $event)
 {
     foreach ($this->registry->getTransportFilters() as $filter) {
         if ($filter->supports($event->getTransport(), $event->getMessage(), $event->getMailRendered())) {
             $filter->filter($event->getTransport(), $event->getMessage(), $event->getMailRendered());
         }
     }
 }
 public function testModel()
 {
     $transport = 'transport_name';
     $message = new \stdClass();
     /* @var MailRenderedInterface $mailRendered */
     $mailRendered = $this->getMockBuilder(MailRenderedInterface::class)->getMock();
     $event = new FilterPreSendEvent($transport, $message, $mailRendered);
     $this->assertSame($transport, $event->getTransport());
     $this->assertSame($message, $event->getMessage());
     $this->assertSame($mailRendered, $event->getMailRendered());
     $transport2 = 'new_transport_name';
     $message2 = new \stdClass();
     $mailRendered2 = null;
     $event->setTransport($transport2);
     $event->setMessage($message2);
     $event->setMailRendered($mailRendered2);
     $this->assertSame($transport2, $event->getTransport());
     $this->assertSame($message2, $event->getMessage());
     $this->assertSame($mailRendered2, $event->getMailRendered());
 }