com php-src: split test for bug #68557 for windows: ext/spl/tests/bug68557-win32.phpt ext/spl/tests/bug68557.phpt

From: Date: Fri, 20 Feb 2015 15:01:34 +0000
Subject: com php-src: split test for bug #68557 for windows: ext/spl/tests/bug68557-win32.phpt ext/spl/tests/bug68557.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85031@lists.php.net to get a copy of this message
Commit: 3082177beebdf148b5b4165f5efbc2c26fd0c01b Author: Anatol Belski <ab@php.net> Fri, 20 Feb 2015 16:01:34 +0100 Parents: 6393556a5d17a163dd8bbc85ea3a661b3112cfd6 Branches: PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3082177beebdf148b5b4165f5efbc2c26fd0c01b Log: split test for bug #68557 for windows Bugs: https://bugs.php.net/68557 Changed paths: A ext/spl/tests/bug68557-win32.phpt M ext/spl/tests/bug68557.phpt Diff: diff --git a/ext/spl/tests/bug68557-win32.phpt b/ext/spl/tests/bug68557-win32.phpt new file mode 100644 index 0000000..95502a5 --- /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 bcf66c9..c862bda 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/.." +

« previous php.cvs (#85031) next »