8000 add Azure and Resend support to the UnsupportedSchemeException · bartrail/symfony@d3fee2c · GitHub
[go: up one dir, main page]

Skip to content

Commit d3fee2c

Browse files
committed
add Azure and Resend support to the UnsupportedSchemeException
1 parent 1fbe559 commit d3fee2c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/Symfony/Component/Mailer/Exception/UnsupportedSchemeException.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
class UnsupportedSchemeException extends LogicException
2121
{
2222
private const SCHEME_TO_PACKAGE_MAP = [
23+
'azure' => [
24+
'class' => Bridge\Azure\Transport\AzureTransportFactory::class,
25+
'package' => 'symfony/azure-mailer',
26+
],
2327
'brevo' => [
2428
'class' => Bridge\Brevo\Transport\BrevoTransportFactory::class,
2529
'package' => 'symfony/brevo-mailer',
@@ -56,6 +60,10 @@ class UnsupportedSchemeException extends LogicException
5660
'class' => Bridge\Postmark\Transport\PostmarkTransportFactory::class,
5761
'package' => 'symfony/postmark-mailer',
5862
],
63+
'resend' => [
64+
'class' => Bridge\Resend\Transport\ResendTransportFactory::class,
65+
'package' => 'symfony/resend-mailer',
66+
],
5967
'scaleway' => [
6068
'class' => Bridge\Scaleway\Transport\ScalewayTransportFactory::class,
6169
'package' => 'symfony/scaleway-mailer',

src/Symfony/Component/Mailer/Tests/Exception/UnsupportedSchemeExceptionTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Bridge\PhpUnit\ClassExistsMock;
1616
use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory;
17+
use Symfony\Component\Mailer\Bridge\Azure\Transport\AzureTransportFactory;
1718
use Symfony\Component\Mailer\Bridge\Brevo\Transport\BrevoTransportFactory;
1819
use Symfony\Component\Mailer\Bridge\Google\Transport\GmailTransportFactory;
1920
use Symfony\Component\Mailer\Bridge\Infobip\Transport\InfobipTransportFactory;
@@ -23,6 +24,7 @@
2324
use Symfony\Component\Mailer\Bridge\Mailjet\Transport\MailjetTransportFactory;
2425
use Symfony\Component\Mailer\Bridge\MailPace\Transport\MailPaceTransportFactory;
2526
use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkTransportFactory;
27+
use Symfony\Component\Mailer\Bridge\Resend\Transport\ResendTransportFactory;
2628
use Symfony\Component\Mailer\Bridge\Scaleway\Transport\ScalewayTransportFactory;
2729
use Symfony\Component\Mailer\Bridge\Sendgrid\Transport\SendgridTransportFactory;
2830
use Symfony\Component\Mailer\Exception\UnsupportedSchemeException;
@@ -37,6 +39,7 @@ public static function setUpBeforeClass(): void
3739
{
3840
ClassExistsMock::register(__CLASS__);
3941
ClassExistsMock::withMockedClasses([
42+
AzureTransportFactory::class => false,
4043
BrevoTransportFactory::class => false,
4144
GmailTransportFactory::class => false,
4245
InfobipTransportFactory::class => false,
@@ -46,6 +49,7 @@ public static function setUpBeforeClass(): void
< 8000 /div>
4649
MailjetTransportFactory::class => false,
4750
MandrillTransportFactory::class => false,
4851
PostmarkTransportFactory::class => false,
52+
ResendTransportFactory::class => false,
4953
ScalewayTransportFactory::class => false,
5054
SendgridTransportFactory::class => false,
5155
SesTransportFactory::class => false,
@@ -67,6 +71,7 @@ public function testMessageWhereSchemeIsPartOfSchemeToPackageMap(string $scheme,
6771

6872
public static function messageWhereSchemeIsPartOfSchemeToPackageMapProvider(): \Generator
6973
{
74+
yield ['azure', 'symfony/azure-mailer'];
7075
yield ['brevo', 'symfony/brevo-mailer'];
7176
yield ['gmail', 'symfony/google-mailer'];
7277
yield ['infobip', 'symfony/infobip-mailer'];
@@ -76,6 +81,7 @@ public static function messageWhereSchemeIsPartOfSchemeToPackageMapProvider(): \
7681
yield ['mailpace', 'symfony/mail-pace-mailer'];
7782
yield ['mandrill', 'symfony/mailchimp-mailer'];
7883
yield ['postmark', 'symfony/postmark-mailer'];
84+
yield ['resend', 'symfony/resend-mailer'];
7985
yield ['scaleway', 'symfony/scaleway-mailer'];
8086
yield ['sendgrid', 'symfony/sendgrid-mailer'];
8187
yield ['ses', 'symfony/amazon-mailer'];

0 commit comments

Comments
 (0)
0