summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoliy Belsky <ab@php.net>2012-05-25 10:52:38 +0200
committerAnatoliy Belsky <ab@php.net>2012-05-25 10:52:38 +0200
commit16a592b13a7909aa9d370fd020a10e00772bc254 (patch)
treef5d9ce5e49c3bdb4460a4ebaafcc0a3f3f556f9e
parent6fb0e4a4019fe98200ca45b8b15b385a7b5d1316 (diff)
parent86d2fafded73511e762671a60d6935ac87d6e39d (diff)
downloadphp-git-16a592b13a7909aa9d370fd020a10e00772bc254.tar.gz
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: Fixed bug #62149 Test Bug - ext/curl/tests/bug61948 Fixed bug #62148 mail_skipif doesn't skip imap tests on Release Build
-rw-r--r--ext/curl/tests/bug61948-win32.phpt25
-rw-r--r--ext/curl/tests/bug61948.phpt5
-rw-r--r--ext/standard/tests/mail/mail_skipif.inc10
3 files changed, 39 insertions, 1 deletions
diff --git a/ext/curl/tests/bug61948-win32.phpt b/ext/curl/tests/bug61948-win32.phpt
new file mode 100644
index 0000000000..dc86526b7b
--- /dev/null
+++ b/ext/curl/tests/bug61948-win32.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
+--SKIPIF--
+<?php if (!extension_loaded("curl")) print "skip";
+if(substr(PHP_OS, 0, 3) != 'WIN' )
+ die("skip Not Valid for Linux");
+?>
+--INI--
+open_basedir="c:/tmp"
+--FILE--
+<?php
+ $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, "c:/xxx/bar"));
+ curl_close($ch);
+?>
+--EXPECTF--
+%a
+
+Warning: curl_setopt(): open_basedir restriction in effect. File(c:/tmp/foo) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
+bool(false)
+
+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
+bool(false)
diff --git a/ext/curl/tests/bug61948.phpt b/ext/curl/tests/bug61948.phpt
index a03fc3b600..23bbda7d5f 100644
--- a/ext/curl/tests/bug61948.phpt
+++ b/ext/curl/tests/bug61948.phpt
@@ -1,7 +1,10 @@
--TEST--
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
--SKIPIF--
-<?php if (!extension_loaded("curl")) print "skip"; ?>
+<?php if (!extension_loaded("curl")) print "skip";
+if(substr(PHP_OS, 0, 3) == 'WIN' )
+ die("skip Not Valid for Windows");
+?>
--INI--
open_basedir="/tmp"
--FILE--
diff --git a/ext/standard/tests/mail/mail_skipif.inc b/ext/standard/tests/mail/mail_skipif.inc
index 2f4fbf3d6f..006594021d 100644
--- a/ext/standard/tests/mail/mail_skipif.inc
+++ b/ext/standard/tests/mail/mail_skipif.inc
@@ -1,5 +1,15 @@
<?php
extension_loaded('imap') or die('skip imap extension not available in this build');
+
+if( substr(PHP_OS, 0, 3) == 'WIN' && extension_loaded('sockets')) {
+ // be sure mail server is accessible... on PHP 5.3.13 release build, using test-pack PHP-5.3-r1af8b3f,
+ // the code below didn't skip test even though there was no mail server
+ // test then failed (no mail server to test against)
+ $socket = socket_create(AF_INET, SOCK_RAW, 1);
+ socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 10, 'usec' => 10));
+ // imap uses tcp port 143
+ socket_connect($socket, "localhost", 143) or die ("skip can't socket to mail server");
+}
// Change these to make tests run successfully
$mailbox = '{localhost}';