com php-src: fork test: ext/sockets/tests/socket_clear_erro r-win32.phpt ext/sockets/tests/socket_clear_error .phpt

From: Date: Mon, 18 Jan 2016 15:59:17 +0000
Subject: com php-src: fork test: ext/sockets/tests/socket_clear_erro r-win32.phpt ext/sockets/tests/socket_clear_error .phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-90681@lists.php.net to get a copy of this message
Commit: fa0dd6006d7ea2ac2b8e0d8e9caa82b11d4f9fe1 Author: Anatol Belski <ab@php.net> Mon, 18 Jan 2016 16:59:17 +0100 Parents: 5673ede6e97d8268ff568e9869de88c8632d2011 Branches: PHP-5.6 PHP-7.0 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fa0dd6006d7ea2ac2b8e0d8e9caa82b11d4f9fe1 Log: fork test Changed paths: A ext/sockets/tests/socket_clear_error-win32.phpt M ext/sockets/tests/socket_clear_error.phpt Diff: diff --git a/ext/sockets/tests/socket_clear_error-win32.phpt b/ext/sockets/tests/socket_clear_error-win32.phpt new file mode 100644 index 0000000..3a0b1ea --- /dev/null +++ b/ext/sockets/tests/socket_clear_error-win32.phpt @@ -0,0 +1,32 @@ +--TEST-- +void socket_clear_error ([ resource $socket ] ) ; +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +<?php +if (!extension_loaded('sockets')) { + die('SKIP sockets extension not available.'); +} +if(substr(PHP_OS, 0, 3) != 'WIN' ) { + die('skip windows only test'); +} +?> +--FILE-- +<?php +$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); +$socketConn = socket_connect($socket, "127.0.0.1", 21248); +var_dump(socket_last_error($socket)); +socket_clear_error($socket); +var_dump(socket_last_error($socket)); +?> +--CLEAN-- +<?php +socket_close($socket); +unset($socket); +unset($socketConn); +?> +--EXPECTF-- +Warning: socket_connect(): unable to connect [%d]: No connection could be made because the target machine actively refused it. + in %s on line %d +int(%d) +int(%d) diff --git a/ext/sockets/tests/socket_clear_error.phpt b/ext/sockets/tests/socket_clear_error.phpt index af9acaa..273f7a0 100644 --- a/ext/sockets/tests/socket_clear_error.phpt +++ b/ext/sockets/tests/socket_clear_error.phpt @@ -7,6 +7,9 @@ marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao p if (!extension_loaded('sockets')) { die('SKIP sockets extension not available.'); } +if(substr(PHP_OS, 0, 3) == 'WIN' ) { + die('skip windows only test'); +} ?> --FILE-- <?php

« previous php.cvs (#90681) next »