Annotation of embedaddon/php/ext/sockets/tests/socket_create_listen-nobind.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test if socket_create_listen() returns false, when it cannot bind to the port.
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('sockets')) {
! 6: die('SKIP The sockets extension is not loaded.');
! 7: }
! 8: $filename = dirname(__FILE__) . '/006_root_check.tmp';
! 9: $fp = fopen($filename, 'w');
! 10: fclose($fp);
! 11: if (fileowner($filename) == 0) {
! 12: unlink ($filename);
! 13: die('SKIP Test cannot be run as root.');
! 14: }
! 15: --FILE--
! 16: <?php
! 17: $sock = socket_create_listen(80);
! 18: --EXPECTF--
! 19: Warning: socket_create_listen(): unable to bind to given address [13]: Permission denied in %s on line %d
! 20: --CLEAN--
! 21: <?php
! 22: unlink(dirname(__FILE__) . '/006_root_check.tmp');
! 23: --CREDITS--
! 24: Till Klampaeckel, till@php.net
! 25: PHP Testfest Berlin 2009-05-09
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>