8000 [Mailer] Add test to resourceName exception case in Azure Bridge · symfony/symfony@d385220 · GitHub
[go: up one dir, main page]

Skip to content

Commit d385220

Browse files
committed
[Mailer] Add test to resourceName exception case in Azure Bridge
1 parent 89badda commit d385220

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Symfony/Component/Mailer/Bridge/Azure/Tests/Transport/AzureApiTransportTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,12 @@ public function testTagAndMetadataHeaders()
117117
$this->assertSame('blue', $payload['headers']['X-Metadata-Color']);
118118
$this->assertSame('12345', $payload['headers']['X-Metadata-Client-ID']);
119119
}
120+
121+
public function testItDoesNotAllowToAddResourceNameWithDot()
122+
{
123+
$this->expectException(\Exception::class);
124+
$this->expectExceptionMessage('Resource name cannot contain or end with a dot');
125+
126+
new AzureApiTransport('KEY', 'ACS_RESOURCE_NAME.');
127+
}
120128
}

src/Symfony/Component/Mailer/Bridge/Azure/Transport/AzureTransportFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function create(Dsn $dsn): TransportInterface
2222
{
2323
$scheme = $dsn->getScheme();
2424

25-
if (\in_array($scheme, ['azure+api', 'azure'], true)) {
25+
if (!in_array($scheme, ['azure+api', 'azure'], true)) {
2626
throw new UnsupportedSchemeException($dsn, 'azure', $this->getSupportedSchemes());
2727
}
2828

0 commit comments

Comments
 (0)
0