@@ -90,7 +90,7 @@ public function connectionToRemoteTCP4n6ServerShouldResultInOurIP()
90
90
91
91
$ ip = Block \await ($ this ->request ('dual.tlund.se ' , $ connector ), $ loop , self ::TIMEOUT );
92
92
93
- $ this ->assertSame ( $ ip , filter_var ($ ip, FILTER_VALIDATE_IP , FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6 ), $ ip );
93
+ $ this ->assertNotFalse ( inet_pton ($ ip) );
94
94
}
95
95
96
96
/**
@@ -110,8 +110,8 @@ public function connectionToRemoteTCP4ServerShouldResultInOurIP()
110
110
throw $ e ;
111
111
}
112
112
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)) );
115
115
}
116
116
117
117
/**
@@ -131,8 +131,8 @@ public function connectionToRemoteTCP6ServerShouldResultInOurIP()
131
131
throw $ e ;
132
132
}
133
133
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)) );
136
136
}
137
137
138
138
public function testCancelPendingTlsConnectionDuringTlsHandshakeShouldCloseTcpConnectionToServer ()
0 commit comments