use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\TransportInterface;
use Symfony\Component\Notifier\Transport\Transports;
class TransportsTest extends TestCase
{ public function testSendToTransportDefinedByMessage() { $transports =
new Transports([ 'one' =>
$one =
$this->
createMock(TransportInterface::
class),
]);
$message =
new ChatMessage('subject'
);
$one->
method('supports'
)->
with($message)->
willReturn(true
);
$one->
expects($this->
once())->
method('send'
)->
willReturn(new SentMessage($message, 'one'
));
$sentMessage =
$transports->
send($message);