summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-02-21 12:36:38 +0800
committerJulien Pauli <jpauli@php.net>2015-02-23 10:35:16 +0100
commitd5a1a3342b0a9a0e571896d19e275435903bcce6 (patch)
tree69276812a66991faea66a7bd62437ef97de443f9
parent591dbcabe57a32550fb73223521fa1323773628f (diff)
downloadphp-git-d5a1a3342b0a9a0e571896d19e275435903bcce6.tar.gz
Fixed test fails for bug68557
-rw-r--r--ext/spl/tests/bug68557-win32.phpt44
-rw-r--r--ext/spl/tests/bug68557.phpt32
2 files changed, 15 insertions, 61 deletions
diff --git a/ext/spl/tests/bug68557-win32.phpt b/ext/spl/tests/bug68557-win32.phpt
deleted file mode 100644
index 95502a53e8..0000000000
--- a/ext/spl/tests/bug68557-win32.phpt
+++ /dev/null
@@ -1,44 +0,0 @@
---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 c862bda7cf..c1ac95257b 100644
--- a/ext/spl/tests/bug68557.phpt
+++ b/ext/spl/tests/bug68557.phpt
@@ -1,11 +1,5 @@
--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');
@@ -15,19 +9,25 @@ touch(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'b');
$d = new DirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
$d->seek(0);
-var_dump($d->current()->getPathname());
+$path0 = $d->current()->getPathname();
$d->seek(1);
-var_dump($d->current()->getPathname());
+$path1 = $d->current()->getPathname();
+
+$d->seek(2);
+$path2 = $d->current()->getPathname();
$d->seek(0);
-var_dump($d->current()->getPathname());
+var_dump($path0 === $d->current()->getPathname());
$d->seek(1);
-var_dump($d->current()->getPathname());
+var_dump($path1 === $d->current()->getPathname());
$d->seek(2);
-var_dump($d->current()->getPathname());
+var_dump($path2 === $d->current()->getPathname());
+
+$d->seek(0);
+var_dump($path0 === $d->current()->getPathname());
?>
--CLEAN--
<?php
@@ -36,9 +36,7 @@ unlink(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'b');
rmdir(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
?>
--EXPECTF--
-string(%d) "%s/tmp/b"
-string(%d) "%s/tmp/a"
-string(%d) "%s/tmp/b"
-string(%d) "%s/tmp/a"
-string(%d) "%s/tmp/.."
-
+bool(true)
+bool(true)
+bool(true)
+bool(true)