Skip to content

Commit b21d084

Browse files
committed
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: split test for bug #68557 for windows
2 parents 95be012 + 3082177 commit b21d084

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

ext/spl/tests/bug68557-win32.phpt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
--TEST--
2+
Bug #68557 (SplFileInfo::getPathname() may be broken)
3+
--SKIPIF--
4+
<?php
5+
if (substr(PHP_OS, 0, 3) != 'WIN') {
6+
die('skip.. only for Windows');
7+
}
8+
?>
9+
--FILE--
10+
<?php
11+
mkdir(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
12+
touch(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'a');
13+
touch(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'b');
14+
15+
$d = new DirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
16+
17+
$d->seek(0);
18+
var_dump($d->current()->getPathname());
19+
20+
$d->seek(1);
21+
var_dump($d->current()->getPathname());
22+
23+
$d->seek(0);
24+
var_dump($d->current()->getPathname());
25+
26+
$d->seek(1);
27+
var_dump($d->current()->getPathname());
28+
29+
$d->seek(2);
30+
var_dump($d->current()->getPathname());
31+
?>
32+
--CLEAN--
33+
<?php
34+
unlink(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'a');
35+
unlink(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'b');
36+
rmdir(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
37+
?>
38+
--EXPECTF--
39+
string(%d) "%s\tmp\."
40+
string(%d) "%s\tmp\.."
41+
string(%d) "%s\tmp\."
42+
string(%d) "%s\tmp\.."
43+
string(%d) "%s\tmp\a"
44+

ext/spl/tests/bug68557.phpt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
--TEST--
22
Bug #68557 (SplFileInfo::getPathname() may be broken)
3+
--SKIPIF--
4+
<?php
5+
if (substr(PHP_OS, 0, 3) == 'WIN') {
6+
die('skip.. Not for Windows');
7+
}
8+
?>
39
--FILE--
410
<?php
511
mkdir(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
@@ -34,4 +40,5 @@ string(%d) "%s/tmp/b"
3440
string(%d) "%s/tmp/a"
3541
string(%d) "%s/tmp/b"
3642
string(%d) "%s/tmp/a"
37-
string(%d) "%s/tmp/.."
43+
string(%d) "%s/tmp/.."
44+

0 commit comments

Comments
 (0)