Skip to content

Commit 1319a11

Browse files
committed
[Notifier] Fix TransportTestCase
Needed for symfony#41985
1 parent db32101 commit 1319a11

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy