forked from HiEventsDev/Hi.Events
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMailConfigurationTest.php
More file actions
30 lines (24 loc) · 998 Bytes
/
Copy pathMailConfigurationTest.php
File metadata and controls
30 lines (24 loc) · 998 Bytes
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
<?php
namespace Tests\Unit\Configuration;
use Illuminate\Mail\MailManager;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
use Tests\TestCase;
class MailConfigurationTest extends TestCase
{
public function test_smtp_transport_can_disable_opportunistic_starttls(): void
{
config([
'mail.mailers.smtp' => array_merge(config('mail.mailers.smtp'), [
'auto_tls' => false,
'verify_peer' => false,
]),
]);
/** @var MailManager $mailManager */
$mailManager = app('mail.manager');
$transport = $mailManager->createSymfonyTransport(config('mail.mailers.smtp'));
$this->assertInstanceOf(EsmtpTransport::class, $transport);
$this->assertFalse($transport->isAutoTls());
$this->assertFalse($transport->getStream()->getStreamOptions()['ssl']['verify_peer']);
$this->assertFalse($transport->getStream()->getStreamOptions()['ssl']['verify_peer_name']);
}
}