@@ -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