@@ -96,7 +96,7 @@ public function testCanSetCustomHost()
96
96
97
97
$ transport ->setHost ($ customHost = self ::CUSTOM_HOST );
98
98
99
- $ this ->assertStringContainsString (sprintf ('://%s ' , $ customHost ), (string ) $ transport );
99
+ $ this ->assertMatchesRegularExpression (sprintf ('/^.*\:\/\/(%s|.*\@%s)/ ' , $ customHost , $ customHost ), (string ) $ transport );
100
100
}
101
101
102
102
public function testCanSetCustomPort ()
@@ -106,9 +106,9 @@ public function testCanSetCustomPort()
106
106
$ transport ->setPort ($ customPort = self ::CUSTOM_PORT );
107
107
108
108
/*
109
- * @see https://regex101.com/r/0xQKuY/2
109
+ * @see https://regex101.com/r/shT9O2/1
110
110
*/
111
- $ this ->assertMatchesRegularExpression (sprintf ('/^.*\/\/.*\ :%s.* $/ ' , $ customPort ), (string ) $ transport );
111
+ $ this ->assertMatchesRegularExpression (sprintf ('/^.*\:\ /\/.*(\@.*)?\ :%s((\?.*|\/.*))? $/ ' , $ customPort ), (string ) $ transport );
112
112
}
113
113
114
114
public function testCanSetCustomHostAndPort ()
@@ -118,6 +118,6 @@ public function testCanSetCustomHostAndPort()
118
118
$ transport ->setHost ($ customHost = self ::CUSTOM_HOST );
119
119
$ transport ->setPort ($ customPort = self ::CUSTOM_PORT );
120
120
121
- $ this ->assertStringContainsString (sprintf ('://%s :%s' , $ customHost , $ customPort ), (string ) $ transport );
121
+ $ this ->assertMatchesRegularExpression (sprintf ('/^.*\:\/\/(%s|.*\@%s)\ :%s/ ' , $ customHost , $ customHost , $ customPort ), (string ) $ transport );
122
122
}
123
123
}
0 commit comments