1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 12:13:02 +02:00

new test for dir iteration (covers some code missing in gcov tests)

This commit is contained in:
Greg Beaver
2007-11-25 05:15:50 +00:00
parent 4bcb68a4e8
commit 38fc1fbc35

View File

@@ -0,0 +1,31 @@
--TEST--
Phar object: iterate test with sub-directories and RecursiveIteratorIterator
--SKIPIF--
<?php if (!extension_loaded('phar')) die('skip'); ?>
<?php if (!extension_loaded("spl")) print "skip SPL not available"; ?>
--INI--
phar.readonly=0
phar.require_hash=0
--FILE--
<?php
$phar = new Phar(dirname(__FILE__) . '/test.phar');
$phar['top.txt'] = 'hi';
$phar['sub/top.txt'] = 'there';
$phar['another.file.txt'] = 'wowee';
$newphar = new Phar(dirname(__FILE__) . '/test.phar');
foreach (new RecursiveIteratorIterator($newphar) as $path => $obj) {
var_dump($obj->getPathName());
}
?>
===DONE===
--CLEAN--
<?php
unlink(dirname(__FILE__) . '/test.phar');
__halt_compiler();
?>
--EXPECTF--
string(%d) "phar://%stest.phar/another.file.txt"
string(%d) "phar://%stest.phar/sub/top.txt"
string(%d) "phar://%stest.phar/top.txt"
===DONE===