From: Máté Kocsis Date: Tue, 4 Aug 2020 07:25:41 +0000 (+0200) Subject: Fix Socket related tests on Windows X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae34a6539fea401fda36592fcd5f0e20bbb39632;p=php Fix Socket related tests on Windows --- diff --git a/ext/sockets/tests/socket_export_stream-4-win.phpt b/ext/sockets/tests/socket_export_stream-4-win.phpt index 6865a880b1..a1899d3eff 100644 --- a/ext/sockets/tests/socket_export_stream-4-win.phpt +++ b/ext/sockets/tests/socket_export_stream-4-win.phpt @@ -16,8 +16,8 @@ function test($stream, $sock) { echo "stream_set_blocking "; try { print_r(stream_set_blocking($stream, 0)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Error $e) { + echo get_class($e), ": ", $e->getMessage(), "\n"; } echo "\n"; } @@ -25,15 +25,15 @@ function test($stream, $sock) { echo "socket_set_block "; try { print_r(socket_set_block($sock)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Error $e) { + echo get_class($e), ": ", $e->getMessage(), "\n"; } echo "\n"; echo "socket_get_option "; try { print_r(socket_get_option($sock, SOL_SOCKET, SO_TYPE)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Error $e) { + echo get_class($e), ": ", $e->getMessage(), "\n"; } echo "\n"; } @@ -90,7 +90,7 @@ stream_set_blocking 1 close stream -stream_set_blocking stream_set_blocking(): supplied resource is not a valid stream resource +stream_set_blocking TypeError: stream_set_blocking(): supplied resource is not a valid stream resource socket_set_block Warning: socket_set_block(): unable to set blocking mode [%d]: An operation was attempted on something that is not a socket. @@ -103,8 +103,8 @@ Warning: socket_get_option(): Unable to retrieve socket option [%d]: An operatio close socket -stream_set_blocking stream_set_blocking(): supplied resource is not a valid stream resource +stream_set_blocking TypeError: stream_set_blocking(): supplied resource is not a valid stream resource -socket_set_block socket_set_block(): supplied resource is not a valid Socket resource +socket_set_block Error: socket_set_block(): Argument #1 ($socket) has already been closed -socket_get_option socket_get_option(): supplied resource is not a valid Socket resource +socket_get_option Error: socket_get_option(): Argument #1 ($socket) has already been closed diff --git a/ext/sockets/tests/socket_import_stream-4-win.phpt b/ext/sockets/tests/socket_import_stream-4-win.phpt index 8040572597..0845d8b510 100644 --- a/ext/sockets/tests/socket_import_stream-4-win.phpt +++ b/ext/sockets/tests/socket_import_stream-4-win.phpt @@ -16,8 +16,8 @@ function test($stream, $sock) { echo "stream_set_blocking "; try { print_r(stream_set_blocking($stream, 0)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Error $e) { + echo get_class($e), ": ", $e->getMessage(), "\n"; } echo "\n"; } @@ -25,15 +25,15 @@ function test($stream, $sock) { echo "socket_set_block "; try { print_r(socket_set_block($sock)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Error $e) { + echo get_class($e), ": ", $e->getMessage(), "\n"; } echo "\n"; echo "socket_get_option "; try { print_r(socket_get_option($sock, SOL_SOCKET, SO_TYPE)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Error $e) { + echo get_class($e), ": ", $e->getMessage(), "\n"; } echo "\n"; } @@ -85,7 +85,7 @@ stream_set_blocking 1 close stream -stream_set_blocking stream_set_blocking(): supplied resource is not a valid stream resource +stream_set_blocking TypeError: stream_set_blocking(): supplied resource is not a valid stream resource socket_set_block Warning: socket_set_block(): unable to set blocking mode [10038]: %s @@ -98,8 +98,8 @@ Warning: socket_get_option(): Unable to retrieve socket option [10038]: %s close socket -stream_set_blocking stream_set_blocking(): supplied resource is not a valid stream resource +stream_set_blocking TypeError: stream_set_blocking(): supplied resource is not a valid stream resource -socket_set_block socket_set_block(): supplied resource is not a valid Socket resource +socket_set_block Error: socket_set_block(): Argument #1 ($socket) has already been closed -socket_get_option socket_get_option(): supplied resource is not a valid Socket resource +socket_get_option Error: socket_get_option(): Argument #1 ($socket) has already been closed diff --git a/ext/sockets/tests/wsaprotocol_info_0.phpt b/ext/sockets/tests/wsaprotocol_info_0.phpt index efe1728f83..7ea50d359f 100644 --- a/ext/sockets/tests/wsaprotocol_info_0.phpt +++ b/ext/sockets/tests/wsaprotocol_info_0.phpt @@ -54,7 +54,8 @@ object(Socket)#%d (0) { } object(Socket)#%d (0) { } -resource(%d) of type (Unknown) +object(Socket)#%d (0) { +} Warning: socket_wsaprotocol_info_export(): Unable to export WSA protocol info [0x00002726]: %s in %s on line %d