8000 fix · symfony/symfony@600a18c · GitHub
[go: up one dir, main page]

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)
0