@@ -96,13 +96,6 @@ public function testCanSetCustomHost()
96
96
97
97
$ transport ->setHost ($ customHost = self ::CUSTOM_HOST );
98
98
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
- // }
106
99
$ this ->assertMatchesRegularExpression (sprintf ('/^.*\:\/\/(%s|.*(\@%s))/ ' , $ customHost , $ customHost ), (string ) $ transport );
107
100
}
108
101
@@ -113,9 +106,9 @@ public function testCanSetCustomPort()
113
106
$ transport ->setPort ($ customPort = self ::CUSTOM_PORT );
114
107
115
108
/*
116
- * @see https://regex101.com/r/Agq19F /1
109
+ * @see https://regex101.com/r/shT9O2 /1
117
110
*/
118
- $ this ->assertMatchesRegularExpression (sprintf ('/^.*\:\/\/.*(\@.*)?\:%s(\?.*)?$/ ' , $ customPort ), (string ) $ transport );
111
+ $ this ->assertMatchesRegularExpression (sprintf ('/^.*\:\/\/.*(\@.*)?\:%s(( \?.*|\/.*) )?$/ ' , $ customPort ), (string ) $ transport );
119
112
}
120
113
121
114
public function testCanSetCustomHostAndPort ()
@@ -125,14 +118,6 @@ public function testCanSetCustomHostAndPort()
125
118
$ transport ->setHost ($ customHost = self ::CUSTOM_HOST );
126
119
$ transport ->setPort ($ customPort = self ::CUSTOM_PORT );
127
120
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
-
136
121
$ this ->assertMatchesRegularExpression (sprintf ('/^.*\:\/\/(%s|.*(\@%s)\:%s)/ ' , $ customHost , $ customHost , $ customPort ), (string ) $ transport );
137
122
}
138
123
}
0 commit comments