@@ -90,7 +90,7 @@ public function connectionToRemoteTCP4n6ServerShouldResultInOurIP()
9090
9191 $ ip = Block \await ($ this ->request ('dual.tlund.se ' , $ connector ), $ loop , self ::TIMEOUT );
9292
93- $ this ->assertSame ( $ ip , filter_var ($ ip, FILTER_VALIDATE_IP , FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6 ), $ ip );
93+ $ this ->assertNotFalse ( inet_pton ($ ip) );
9494 }
9595
9696 /**
@@ -110,8 +110,8 @@ public function connectionToRemoteTCP4ServerShouldResultInOurIP()
110110 throw $ e ;
111111 }
112112
113- $ this ->assertSame ( $ ip , filter_var ($ ip, FILTER_VALIDATE_IP , FILTER_FLAG_IPV4 ), $ ip );
114- $ this ->assertFalse ( filter_var ( $ ip , FILTER_VALIDATE_IP , FILTER_FLAG_IPV6 ), $ ip );
113+ $ this ->assertNotFalse ( inet_pton ($ ip) );
114+ $ this ->assertEquals ( 4 , strlen ( inet_pton ( $ ip)) );
115115 }
116116
117117 /**
@@ -131,8 +131,8 @@ public function connectionToRemoteTCP6ServerShouldResultInOurIP()
131131 throw $ e ;
132132 }
133133
134- $ this ->assertFalse ( filter_var ($ ip, FILTER_VALIDATE_IP , FILTER_FLAG_IPV4 ), $ ip );
135- $ this ->assertSame ( $ ip , filter_var ( $ ip, FILTER_VALIDATE_IP , FILTER_FLAG_IPV6 ), $ ip );
134+ $ this ->assertNotFalse ( inet_pton ($ ip) );
135+ $ this ->assertEquals ( 16 , strlen ( inet_pton ( $ ip)) );
136136 }
137137
138138 public function testCancelPendingTlsConnectionDuringTlsHandshakeShouldCloseTcpConnectionToServer ()
0 commit comments