Skip to content

Commit

Permalink
add test for roundrobin transport driver
Browse files Browse the repository at this point in the history
  • Loading branch information
me-shaon committed Dec 19, 2023
1 parent f7d55a5 commit f662dfa
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions tests/Mail/MailRoundRobinTransportTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace Illuminate\Tests\Mail;

use Orchestra\Testbench\TestCase;
use Symfony\Component\Mailer\Transport\RoundRobinTransport;

class MailRoundRobinTransportTest extends TestCase
{
public function testGetRoundRobinTransportWithConfiguredTransports()
{
$this->app['config']->set('mail.default', 'roundrobin');

$this->app['config']->set('mail.mailers', [
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'sendmail',
'array',
],
],

'sendmail' => [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
],

'array' => [
'transport' => 'array',
],
]);

$transport = app('mailer')->getSymfonyTransport();
$this->assertInstanceOf(RoundRobinTransport::class, $transport);
}

public function testGetRoundRobinTransportWithLaravel6StyleMailConfiguration()
{
$this->app['config']->set('mail.driver', 'roundrobin');

$this->app['config']->set('mail.mailers', [
'sendmail',
'array',
]);

$this->app['config']->set('mail.sendmail', '/usr/sbin/sendmail -bs');

$transport = app('mailer')->getSymfonyTransport();
$this->assertInstanceOf(RoundRobinTransport::class, $transport);
}
}

0 comments on commit f662dfa

Please sign in to comment.