File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -194,9 +194,7 @@ protected function createSmtpTransport(array $config)
194
194
$ scheme = $ config ['scheme ' ] ?? null ;
195
195
196
196
if (! $ scheme ) {
197
- $ scheme = ! empty ($ config ['encryption ' ]) && $ config ['encryption ' ] === 'tls '
198
- ? (($ config ['port ' ] == 465 ) ? 'smtps ' : 'smtp ' )
199
- : '' ;
197
+ $ scheme = ($ config ['port ' ] == 465 ) ? 'smtps ' : 'smtp ' ;
200
198
}
201
199
202
200
$ transport = $ factory ->create (new Dsn (
Original file line number Diff line number Diff line change 5
5
use InvalidArgumentException ;
6
6
use Orchestra \Testbench \TestCase ;
7
7
use PHPUnit \Framework \Attributes \DataProvider ;
8
+ use PHPUnit \Framework \Attributes \TestWith ;
8
9
use Symfony \Component \Mailer \Transport \Smtp \EsmtpTransport ;
9
10
10
11
class MailManagerTest extends TestCase
@@ -27,9 +28,12 @@ public function testEmptyTransportConfig($transport)
27
28
$ this ->app ['mail.manager ' ]->mailer ('custom_smtp ' );
28
29
}
29
30
30
- public function testMailUrlConfig ()
31
+ #[TestWith(['smtp ' ])]
32
+ #[TestWith(['smtps ' ])]
33
+ public function testMailUrlConfig ($ scheme )
31
34
{
32
35
$ this ->app ['config ' ]->set ('mail.mailers.smtp_url ' , [
36
+ 'scheme ' => $ scheme ,
33
37
'url ' => 'smtp://usr:pwd@127.0.0.2:5876 ' ,
34
38
]);
35
39
You can’t perform that action at this time.
0 commit comments