com php-src: fix test: ext/curl/tests/bug61948-win32.phpt
| From: | Anatol Belski | Date: | Sun, 04 Dec 2016 16:28:43 +0000 |
| Subject: | com php-src: fix test: ext/curl/tests/bug61948-win32.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96181@lists.php.net to get a copy of this message | ||
Commit: 8e209d043559a7d60bea50fcac23bfa87b3015d7
Author: Anatol Belski <ab@php.net> Sun, 4 Dec 2016 17:28:43 +0100
Parents: 10a2ceef3bfada85e7046231476d06f08d3de69c
Branches: PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8e209d043559a7d60bea50fcac23bfa87b3015d7
Log:
fix test
Changed paths:
M ext/curl/tests/bug61948-win32.phpt
Diff:
diff --git a/ext/curl/tests/bug61948-win32.phpt b/ext/curl/tests/bug61948-win32.phpt
index 00f498f..b91ccb7 100644
--- a/ext/curl/tests/bug61948-win32.phpt
+++ b/ext/curl/tests/bug61948-win32.phpt
@@ -5,19 +5,28 @@ Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
if(substr(PHP_OS, 0, 3) != 'WIN' )
die("skip Not Valid for Linux");
?>
---INI--
-open_basedir="c:/tmp"
--FILE--
<?php
+ $base_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug61948";
+ mkdir($base_dir . DIRECTORY_SEPARATOR . "foo", 0755, true);
+
+ ini_set("open_basedir", $base_dir);
+
$ch = curl_init();
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
- var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/tmp/foo"));
+ var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "$base_dir/foo"));
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/xxx/bar"));
curl_close($ch);
?>
+--CLEAN--
+<?php
+ $base_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug61948";
+ rmdir("$base_dir/foo");
+ rmdir($base_dir);
+?>
--EXPECTF--
%a
bool(true)
-Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the
allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
+Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the
allowed path(s): (%sbug61948) in %sbug61948-win32.php on line %d
bool(false)