From 1c0d01522c5d20a0bdc0a46b014a67e6fdb53865 Mon Sep 17 00:00:00 2001 From: marcosptf Date: Tue, 17 Nov 2015 22:08:08 -0200 Subject: test to function socket_send(); --- ext/sockets/tests/socket_send.phpt | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 ext/sockets/tests/socket_send.phpt (limited to 'ext/sockets') diff --git a/ext/sockets/tests/socket_send.phpt b/ext/sockets/tests/socket_send.phpt new file mode 100644 index 0000000000..1411868c4b --- /dev/null +++ b/ext/sockets/tests/socket_send.phpt @@ -0,0 +1,50 @@ +--TEST-- +int socket_send ( resource $socket , string $buf , int $len , int $flags ); +--CREDITS-- +marcosptf - - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +okey +okey +okey +okey -- cgit v1.2.1 From e9d3ff0ec7dda34dec3e36cdd63bfb4170c6e611 Mon Sep 17 00:00:00 2001 From: marcosptf Date: Mon, 16 Nov 2015 19:39:06 -0200 Subject: test to function socket_shutdown(); --- ext/sockets/tests/socket_shutdown.phpt | 54 ++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 ext/sockets/tests/socket_shutdown.phpt (limited to 'ext/sockets') diff --git a/ext/sockets/tests/socket_shutdown.phpt b/ext/sockets/tests/socket_shutdown.phpt new file mode 100644 index 0000000000..09f5ac73fc --- /dev/null +++ b/ext/sockets/tests/socket_shutdown.phpt @@ -0,0 +1,54 @@ +--TEST-- +bool socket_shutdown ( resource $socket [, int $how = 2 ] ) ; +--CREDITS-- +marcosptf - - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +bool(true) +bool(true) +bool(true) + +Warning: socket_shutdown(): unable to shutdown socket [%d]: Transport endpoint is not connected in %s on line %d +bool(false) + +Warning: socket_shutdown(): unable to shutdown socket [%d]: Invalid argument in %s on line %d +bool(false) -- cgit v1.2.1 From 7f31a88bb8493eaa4968db6169b939342f0ba0f7 Mon Sep 17 00:00:00 2001 From: marcosptf Date: Mon, 16 Nov 2015 16:26:39 -0200 Subject: test to function socket_getopt(); --- ext/sockets/tests/socket_getopt.phpt | 74 ++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 ext/sockets/tests/socket_getopt.phpt (limited to 'ext/sockets') diff --git a/ext/sockets/tests/socket_getopt.phpt b/ext/sockets/tests/socket_getopt.phpt new file mode 100644 index 0000000000..639328cc62 --- /dev/null +++ b/ext/sockets/tests/socket_getopt.phpt @@ -0,0 +1,74 @@ +--TEST-- +mixed socket_getopt( resource $socket , int $level , int $optname ) ; +--CREDITS-- +marcosptf - - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +if (!extension_loaded('sockets')) { + die('skip sockets extension not available.'); +} +if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) { + die("skip interface 1 either doesn't exist or has no ipv4 address"); +} +--FILE-- + +--CLEAN-- + +--EXPECT-- +Setting IP_MULTICAST_TTL +bool(true) +int(9) + +Setting IP_MULTICAST_LOOP +bool(true) +int(0) +bool(true) +int(1) + +Setting IP_MULTICAST_IF +interface 0: +bool(true) +int(0) +interface 1: +bool(true) +int(1) -- cgit v1.2.1 From d73d9fecf6c7a4cf2a7443f1a3833c8fb6e30ea1 Mon Sep 17 00:00:00 2001 From: Julien Pauli Date: Thu, 24 Dec 2015 13:33:22 +0100 Subject: Fixed and improved tests --- ext/sockets/tests/socket_clear_error.phpt | 28 ++++++++++++++++++++++++++++ ext/sockets/tests/socket_getopt.phpt | 5 ++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 ext/sockets/tests/socket_clear_error.phpt (limited to 'ext/sockets') diff --git a/ext/sockets/tests/socket_clear_error.phpt b/ext/sockets/tests/socket_clear_error.phpt new file mode 100644 index 0000000000..af9acaa9bf --- /dev/null +++ b/ext/sockets/tests/socket_clear_error.phpt @@ -0,0 +1,28 @@ +--TEST-- +void socket_clear_error ([ resource $socket ] ) ; +--CREDITS-- +marcosptf - - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +Warning: socket_connect(): unable to connect [%d]: Connection refused in %s on line %d +int(%d) +int(%d) diff --git a/ext/sockets/tests/socket_getopt.phpt b/ext/sockets/tests/socket_getopt.phpt index 639328cc62..12c0aeb888 100644 --- a/ext/sockets/tests/socket_getopt.phpt +++ b/ext/sockets/tests/socket_getopt.phpt @@ -3,12 +3,11 @@ mixed socket_getopt( resource $socket , int $level , int $optname ) ; --CREDITS-- marcosptf - - #phparty7 - @phpsp - novatec/2015 - sao paulo - br --SKIPIF-- + --FILE-- Date: Fri, 1 Jan 2016 19:19:27 +0200 Subject: Happy new year (Update copyright to 2016) --- ext/sockets/multicast.c | 2 +- ext/sockets/multicast.h | 2 +- ext/sockets/php_sockets.h | 2 +- ext/sockets/sendrecvmsg.c | 2 +- ext/sockets/sockets.c | 2 +- ext/sockets/unix_socket_constants.h | 2 +- ext/sockets/win32_socket_constants.h | 2 +- ext/sockets/windows_common.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'ext/sockets') diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c index 950b998391..b1a028b7bb 100644 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h index 4882c0c510..91ae8b5972 100644 --- a/ext/sockets/multicast.h +++ b/ext/sockets/multicast.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h index 6b6e3b1773..8abf25d6a6 100644 --- a/ext/sockets/php_sockets.h +++ b/ext/sockets/php_sockets.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/sockets/sendrecvmsg.c b/ext/sockets/sendrecvmsg.c index b450bab058..5550f4d20f 100644 --- a/ext/sockets/sendrecvmsg.c +++ b/ext/sockets/sendrecvmsg.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 9644d79fc5..c5bcf676d9 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/sockets/unix_socket_constants.h b/ext/sockets/unix_socket_constants.h index 6ec3c7ecc3..51136a85d8 100644 --- a/ext/sockets/unix_socket_constants.h +++ b/ext/sockets/unix_socket_constants.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/sockets/win32_socket_constants.h b/ext/sockets/win32_socket_constants.h index dbb4efe6d4..c0aa54754e 100644 --- a/ext/sockets/win32_socket_constants.h +++ b/ext/sockets/win32_socket_constants.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/sockets/windows_common.h b/ext/sockets/windows_common.h index e1e328a46e..b5f3c6bdb4 100644 --- a/ext/sockets/windows_common.h +++ b/ext/sockets/windows_common.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | -- cgit v1.2.1