summaryrefslogtreecommitdiff
path: root/ext/sockets
diff options
context:
space:
mode:
Diffstat (limited to 'ext/sockets')
-rw-r--r--ext/sockets/tests/socket_create_listen-nobind.phpt8
-rw-r--r--ext/sockets/tests/socket_set_option_error_socket_option.phpt8
2 files changed, 6 insertions, 10 deletions
diff --git a/ext/sockets/tests/socket_create_listen-nobind.phpt b/ext/sockets/tests/socket_create_listen-nobind.phpt
index 81e7297339..d6a9a767a3 100644
--- a/ext/sockets/tests/socket_create_listen-nobind.phpt
+++ b/ext/sockets/tests/socket_create_listen-nobind.phpt
@@ -5,13 +5,14 @@ Test if socket_create_listen() returns false, when it cannot bind to the port.
if (!extension_loaded('sockets')) {
die('SKIP The sockets extension is not loaded.');
}
-$filename = __DIR__ . '/006_root_check.tmp';
+$filename = __FILE__ . '.root_check.tmp';
$fp = fopen($filename, 'w');
fclose($fp);
if (fileowner($filename) == 0) {
- unlink ($filename);
+ unlink($filename);
die('SKIP Test cannot be run as root.');
}
+unlink($filename);
if (@socket_create_listen(80)) {
die('SKIP Test cannot be run in environment that will allow binding to port 80 (azure)');
}
@@ -20,9 +21,6 @@ if (@socket_create_listen(80)) {
$sock = socket_create_listen(80);
--EXPECTF--
Warning: socket_create_listen(): unable to bind to given address [13]: Permission denied in %s on line %d
---CLEAN--
-<?php
-unlink(__DIR__ . '/006_root_check.tmp');
--CREDITS--
Till Klampaeckel, till@php.net
PHP Testfest Berlin 2009-05-09
diff --git a/ext/sockets/tests/socket_set_option_error_socket_option.phpt b/ext/sockets/tests/socket_set_option_error_socket_option.phpt
index 18afcc8fb1..53d76fa4c1 100644
--- a/ext/sockets/tests/socket_set_option_error_socket_option.phpt
+++ b/ext/sockets/tests/socket_set_option_error_socket_option.phpt
@@ -8,13 +8,14 @@ if (!extension_loaded('sockets')) {
if (PHP_OS == 'Darwin') {
die('skip Not for OSX');
}
-$filename = __DIR__ . '/006_root_check.tmp';
+$filename = __FILE__ . '.root_check.tmp';
$fp = fopen($filename, 'w');
fclose($fp);
if (fileowner($filename) == 0) {
- unlink ($filename);
+ unlink($filename);
die('SKIP Test cannot be run as root.');
}
+unlink($filename);
?>
--FILE--
<?php
@@ -26,9 +27,6 @@ if (!$socket) {
socket_set_option( $socket, SOL_SOCKET, 1, 1);
socket_close($socket);
?>
---CLEAN--
-<?php
-unlink(__DIR__ . '/006_root_check.tmp');
--EXPECTF--
Warning: socket_set_option(): unable to set socket option [%d]: Permission denied in %s on line %d
--CREDITS--