]> granicus.if.org Git - php/commitdiff
Fix possible test failure with path > 108
authorRemi Collet <remi@php.net>
Mon, 29 May 2017 09:17:32 +0000 (11:17 +0200)
committerRemi Collet <remi@php.net>
Mon, 29 May 2017 09:17:32 +0000 (11:17 +0200)
E.g.  Notice: stream_socket_server(): socket path exceeded the maximum allowed length of 108 bytes and was truncated in /builddir/build/BUILD/php-src-32d7fa6f74b56fed8124d4dea0f98f0f9964a64e/ext/standard/tests/streams/bug74556.php on line 4

ext/standard/tests/streams/bug74556.phpt

index 016a3dce863b5a4cae11dc18db980ef9f8f6afbe..121426105a7f0acece932a23d41b7ae9b5f2fe91 100644 (file)
@@ -6,7 +6,7 @@ if (!strncasecmp(PHP_OS, 'WIN', 3)) echo "skip Unix Only";
 --FILE--
 <?php
 
-$sock = __DIR__ . '/bug74556.sock';
+$sock = tempnam(sys_get_temp_dir(), 'bug74556') . '.sock';
 $s = stream_socket_server("unix://$sock");
 $c = stream_socket_client("unix://$sock");
 
@@ -14,9 +14,7 @@ var_dump(
     stream_socket_get_name($s, true),
     stream_socket_get_name($c, false)
 );
---CLEAN--
-<?php
-unlink(__DIR__ . '/bug74556.sock');
+unlink($sock);
 --EXPECT--
 bool(false)
 bool(false)