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:
31
ext/phar/tests/phar_dir_iterate.phpt
Normal file
31
ext/phar/tests/phar_dir_iterate.phpt
Normal 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===
|
||||
Reference in New Issue
Block a user