1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
<?php
namespace Illuminate\Tests\Mail;
use Orchestra\Testbench\TestCase;
use Symfony\Component\Mailer\Transport\FailoverTransport;
class MailFailoverTransportTest extends TestCase
{
public function testGetFailoverTransportWithConfiguredTransports()
{
$this->app['config']->set('mail.default', 'failover');
$this->app['config']->set('mail.mailers', [
'failover' => [
'transport' => 'failover',
'mailers' => [
'sendmail',
'array',
],
],
'sendmail' => [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
],
'array' => [
'transport' => 'array',
],
]);
$transport = app('mailer')->getSymfonyTransport();
$this->assertInstanceOf(FailoverTransport::class, $transport);
}
public function testGetFailoverTransportWithLaravel6StyleMailConfiguration()
{
$this->app['config']->set('mail.driver', 'failover');
$this->app['config']->set('mail.mailers', [
'sendmail',
'array',
]);
$this->app['config']->set('mail.sendmail', '/usr/sbin/sendmail -bs');
$transport = app('mailer')->getSymfonyTransport();
$this->assertInstanceOf(FailoverTransport::class, $transport);
}
}
|