summaryrefslogtreecommitdiff
path: root/ext/sockets
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-08-04 09:25:41 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-08-04 09:25:41 +0200
commitae34a6539fea401fda36592fcd5f0e20bbb39632 (patch)
tree2edad3a6a002c971782ef55fa5dce64d82357b51 /ext/sockets
parent2d32b633b26b39fdc96bd95415a5487f1de47d72 (diff)
downloadphp-git-ae34a6539fea401fda36592fcd5f0e20bbb39632.tar.gz
Fix Socket related tests on Windows
Diffstat (limited to 'ext/sockets')
-rw-r--r--ext/sockets/tests/socket_export_stream-4-win.phpt20
-rw-r--r--ext/sockets/tests/socket_import_stream-4-win.phpt20
-rw-r--r--ext/sockets/tests/wsaprotocol_info_0.phpt3
3 files changed, 22 insertions, 21 deletions
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