Skip to content

Commit 600a18c

Browse files
committed
fix
1 parent 0f8161d commit 600a18c

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

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

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ public function testCanSetCustomHost()
9696

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

99-
$transportAsString = (string) $transport;
100-
101-
// if (false !== strpos($transportAsString, '@')) {
102-
// $this->assertStringContainsString(sprintf('@%s', $customHost), $transportAsString);
103-
// } else {
104-
// $this->assertStringContainsString(sprintf('://%s', $customHost), $transportAsString);
105-
// }
10699
$this->assertMatchesRegularExpression(sprintf('/^.*\:\/\/(%s|.*(\@%s))/', $customHost, $customHost), (string) $transport);
107100
}
108101

@@ -113,9 +106,9 @@ public function testCanSetCustomPort()
113106
$transport->setPort($customPort = self::CUSTOM_PORT);
114107

115108
/*
116-
* @see https://regex101.com/r/Agq19F/1
109+
* @see https://regex101.com/r/shT9O2/1
117110
*/
118-
$this->assertMatchesRegularExpression(sprintf('/^.*\:\/\/.*(\@.*)?\:%s(\?.*)?$/', $customPort), (string) $transport);
111+
$this->assertMatchesRegularExpression(sprintf('/^.*\:\/\/.*(\@.*)?\:%s((\?.*|\/.*))?$/', $customPort), (string) $transport);
119112
}
120113

121114
public function testCanSetCustomHostAndPort()
@@ -125,14 +118,6 @@ public function testCanSetCustomHostAndPort()
125118
$transport->setHost($customHost = self::CUSTOM_HOST);
126119
$transport->setPort($customPort = self::CUSTOM_PORT);
127120

128-
$transportAsString = (string) $transport;
129-
130-
// if (false !== strpos($transportAsString, '@')) {
131-
// $this->assertStringContainsString(sprintf('@%s:%s', $customHost, $customPort), $transportAsString);
132-
// } else {
133-
// $this->assertStringContainsString(sprintf('://%s:%s', $customHost, $customPort), $transportAsString);
134-
// }
135-
136121
$this->assertMatchesRegularExpression(sprintf('/^.*\:\/\/(%s|.*(\@%s)\:%s)/', $customHost, $customHost, $customPort), (string) $transport);
137122
}
138123
}

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