]> granicus.if.org Git - php/commitdiff
Fixed bug #61632 Test ext\sockets\tests\socket_create_listen.phpt fails
authorAnatoliy Belsky <ab@php.net>
Tue, 10 Apr 2012 10:57:10 +0000 (12:57 +0200)
committerAnatoliy Belsky <ab@php.net>
Tue, 10 Apr 2012 11:06:14 +0000 (13:06 +0200)
ext/sockets/tests/socket_create_listen-win32.phpt [new file with mode: 0644]
ext/sockets/tests/socket_create_listen.phpt

diff --git a/ext/sockets/tests/socket_create_listen-win32.phpt b/ext/sockets/tests/socket_create_listen-win32.phpt
new file mode 100644 (file)
index 0000000..23bf963
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--
+Test if socket binds on 31338
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+       die('skip.. Not valid for non Windows');
+}
+if (!extension_loaded('sockets')) {
+    die('SKIP The sockets extension is not loaded.');
+}
+--FILE--
+<?php
+$sock = socket_create_listen(31338);
+socket_getsockname($sock, $addr, $port); 
+var_dump($addr, $port);
+--EXPECT--
+string(9) "127.0.0.1"
+int(31338)
+--CREDITS--
+Till Klampaeckel, till@php.net
+PHP Testfest Berlin 2009-05-09
index 440fade61d9f306e45596b91de6b44e509f2520c..76f29425877a69a4d8be268e5986b0cef2afaeef 100644 (file)
@@ -2,6 +2,9 @@
 Test if socket binds on 31338
 --SKIPIF--
 <?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+       die('skip.. Not valid for Windows');
+}
 if (!extension_loaded('sockets')) {
     die('SKIP The sockets extension is not loaded.');
 }