php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch 61632.diff for Sockets related Bug #61632

Patch version 2012-04-05 12:56 UTC

Return to Bug #61632 | Download this patch
Patch Revisions:

Developer: ab@php.net

diff --git a/ext/sockets/tests/socket_create_listen.phpt b/ext/sockets/tests/socket_create_listen.phpt
index 440fade..76f2942 100644
--- a/ext/sockets/tests/socket_create_listen.phpt
+++ b/ext/sockets/tests/socket_create_listen.phpt
@@ -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.');
 }
--- a/ext/sockets/tests/socket_create_listen-win32.phpt	Thu Apr  5 14:46:26 2012
+++ b/ext/sockets/tests/socket_create_listen-win32.phpt	Thu Apr  5 14:46:26 2012
@@ -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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 18:01:29 2024 UTC