Annotation of embedaddon/php/ext/phar/tests/phar_dir_iterate.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Phar object: iterate test with sub-directories and RecursiveIteratorIterator
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded('phar')) die('skip'); ?>
! 5: <?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
! 6: --INI--
! 7: phar.readonly=0
! 8: phar.require_hash=0
! 9: --FILE--
! 10: <?php
! 11: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
! 12:
! 13: $phar = new Phar($fname);
! 14: $phar['top.txt'] = 'hi';
! 15: $phar['sub/top.txt'] = 'there';
! 16: $phar['another.file.txt'] = 'wowee';
! 17: $newphar = new Phar($fname);
! 18: foreach (new RecursiveIteratorIterator($newphar) as $path => $obj) {
! 19: var_dump($obj->getPathName());
! 20: }
! 21: ?>
! 22: ===DONE===
! 23: --CLEAN--
! 24: <?php
! 25: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
! 26: __halt_compiler();
! 27: ?>
! 28: --EXPECTF--
! 29: string(%d) "phar://%sphar_dir_iterate.phar.php%canother.file.txt"
! 30: string(%d) "phar://%sphar_dir_iterate.phar.php/sub%ctop.txt"
! 31: string(%d) "phar://%sphar_dir_iterate.phar.php%ctop.txt"
! 32: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>