Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 05891cf

Browse filesBrowse files
committed
Fix: Mailjet bridge tests
1 parent 5010ebd commit 05891cf
Copy full SHA for 05891cf

File tree

Expand file treeCollapse file tree

3 files changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+8
-8
lines changed

‎src/Symfony/Component/Notifier/Bridge/Mailjet/Tests/MailjetTransportFactoryTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Notifier/Bridge/Mailjet/Tests/MailjetTransportFactoryTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public function supportsProvider(): iterable
3939
yield [false, 'somethingElse://Mailjet:authtoken@default'];
4040
}
4141

42-
public function missingRequiredOptionProvider(): iterable
42+
public function incompleteDsnProvider(): iterable
4343
{
44-
yield 'missing option: from' => ['mailjet://authtoken@default'];
44+
yield 'missing from' => ['mailjet://authtoken@default', 'Invalid "mailjet://authtoken@default" notifier DSN: Password is not set.'];
4545
}
4646

4747
public function unsupportedSchemeProvider(): iterable

‎src/Symfony/Component/Notifier/Bridge/Mailjet/Tests/MailjetTransportTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Notifier/Bridge/Mailjet/Tests/MailjetTransportTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ final class MailjetTransportTest extends TransportTestCase
2424
/**
2525
* @return MailjetTransport
2626
*/
27-
public function createTransport(?HttpClientInterface $client = null): TransportInterface
27+
public function createTransport(HttpClientInterface $client = null): TransportInterface
2828
{
2929
return (new MailjetTransport('authtoken', 'Mailjet', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
3030
}
3131

3232
public function toStringProvider(): iterable
3333
{
34-
yield ['mailjet://Mailjet:authtoken@host.test', $this->createTransport()];
34+
yield ['mailjet://Mailjet@host.test', $this->createTransport()];
3535
}
3636

3737
public function supportedMessagesProvider(): iterable

‎src/Symfony/Component/Notifier/Test/TransportTestCase.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Notifier/Test/TransportTestCase.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function testCanSetCustomHost()
9696

9797
$transport->setHost($customHost = self::CUSTOM_HOST);
9898

99-
$this->assertStringContainsString(sprintf('://%s', $customHost), (string) $transport);
99+
$this->assertMatchesRegularExpression(sprintf('/^.*\:\/\/(%s|.*(\@%s))/', $customHost, $customHost), (string) $transport);
100100
}
101101

102102
public function testCanSetCustomPort()
@@ -106,9 +106,9 @@ public function testCanSetCustomPort()
106106
$transport->setPort($customPort = self::CUSTOM_PORT);
107107

108108
/*
109-
* @see https://regex101.com/r/0xQKuY/2
109+
* @see https://regex101.com/r/shT9O2/1
110110
*/
111-
$this->assertMatchesRegularExpression(sprintf('/^.*\/\/.*\:%s.*$/', $customPort), (string) $transport);
111+
$this->assertMatchesRegularExpression(sprintf('/^.*\:\/\/.*(\@.*)?\:%s((\?.*|\/.*))?$/', $customPort), (string) $transport);
112112
}
113113

114114
public function testCanSetCustomHostAndPort()
@@ -118,6 +118,6 @@ public function testCanSetCustomHostAndPort()
118118
$transport->setHost($customHost = self::CUSTOM_HOST);
119119
$transport->setPort($customPort = self::CUSTOM_PORT);
120120

121-
$this->assertStringContainsString(sprintf('://%s:%s', $customHost, $customPort), (string) $transport);
121+
$this->assertMatchesRegularExpression(sprintf('/^.*\:\/\/(%s|.*(\@%s)\:%s)/', $customHost, $customHost, $customPort), (string) $transport);
122122
}
123123
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.