forked from laravel/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[10.x] Add url support for mail config (laravel#46964)
* Add url support for mail config * ci fix * formatting --------- Co-authored-by: Taylor Otwell <[email protected]>
- Loading branch information
1 parent
1e6b467
commit 07a5e09
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
use InvalidArgumentException; | ||
use Orchestra\Testbench\TestCase; | ||
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; | ||
|
||
class MailManagerTest extends TestCase | ||
{ | ||
|
@@ -27,6 +28,22 @@ public function testEmptyTransportConfig($transport) | |
$this->app['mail.manager']->mailer('custom_smtp'); | ||
} | ||
|
||
public function testMailUrlConfig() | ||
{ | ||
$this->app['config']->set('mail.mailers.smtp_url', [ | ||
'url' => 'smtp://usr:[email protected]:5876', | ||
]); | ||
|
||
$mailer = $this->app['mail.manager']->mailer('smtp_url'); | ||
$transport = $mailer->getSymfonyTransport(); | ||
|
||
$this->assertInstanceOf(EsmtpTransport::class, $transport); | ||
$this->assertSame('usr', $transport->getUsername()); | ||
$this->assertSame('pwd', $transport->getPassword()); | ||
$this->assertSame('127.0.0.2', $transport->getStream()->getHost()); | ||
$this->assertSame(5876, $transport->getStream()->getPort()); | ||
} | ||
|
||
public static function emptyTransportConfigDataProvider() | ||
{ | ||
return [ | ||
|