summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2015-02-20 16:02:07 +0100
committerAnatol Belski <ab@php.net>2015-02-20 16:02:07 +0100
commitb21d0848c9cd313191dd62e8f21f9c16d08818ed (patch)
tree956b7857a4c98c223534bad94d2cac7a26027bb3
parent95be012dcec003752bc43b3d8ed7ff7c3c0c4f85 (diff)
parent3082177beebdf148b5b4165f5efbc2c26fd0c01b (diff)
downloadphp-git-b21d0848c9cd313191dd62e8f21f9c16d08818ed.tar.gz
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: split test for bug #68557 for windows
-rw-r--r--ext/spl/tests/bug68557-win32.phpt44
-rw-r--r--ext/spl/tests/bug68557.phpt9
2 files changed, 52 insertions, 1 deletions
diff --git a/ext/spl/tests/bug68557-win32.phpt b/ext/spl/tests/bug68557-win32.phpt
new file mode 100644
index 0000000000..95502a53e8
--- /dev/null
+++ b/ext/spl/tests/bug68557-win32.phpt
@@ -0,0 +1,44 @@
+--TEST--
+Bug #68557 (SplFileInfo::getPathname() may be broken)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die('skip.. only for Windows');
+}
+?>
+--FILE--
+<?php
+mkdir(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
+touch(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'a');
+touch(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'b');
+
+$d = new DirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
+
+$d->seek(0);
+var_dump($d->current()->getPathname());
+
+$d->seek(1);
+var_dump($d->current()->getPathname());
+
+$d->seek(0);
+var_dump($d->current()->getPathname());
+
+$d->seek(1);
+var_dump($d->current()->getPathname());
+
+$d->seek(2);
+var_dump($d->current()->getPathname());
+?>
+--CLEAN--
+<?php
+unlink(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'a');
+unlink(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'b');
+rmdir(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
+?>
+--EXPECTF--
+string(%d) "%s\tmp\."
+string(%d) "%s\tmp\.."
+string(%d) "%s\tmp\."
+string(%d) "%s\tmp\.."
+string(%d) "%s\tmp\a"
+
diff --git a/ext/spl/tests/bug68557.phpt b/ext/spl/tests/bug68557.phpt
index bcf66c9d24..c862bda7cf 100644
--- a/ext/spl/tests/bug68557.phpt
+++ b/ext/spl/tests/bug68557.phpt
@@ -1,5 +1,11 @@
--TEST--
Bug #68557 (SplFileInfo::getPathname() may be broken)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die('skip.. Not for Windows');
+}
+?>
--FILE--
<?php
mkdir(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
@@ -34,4 +40,5 @@ string(%d) "%s/tmp/b"
string(%d) "%s/tmp/a"
string(%d) "%s/tmp/b"
string(%d) "%s/tmp/a"
-string(%d) "%s/tmp/.." \ No newline at end of file
+string(%d) "%s/tmp/.."
+