php-src/ext/phar/tests/phar_oo_005.phpt

61 lines
1.4 KiB
Plaintext
Raw Normal View History

2006-03-04 18:46:51 +00:00
--TEST--
Phar and RecursiveDirectoryIterator
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
<?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
--INI--
phar.require_hash=0
2006-03-04 18:46:51 +00:00
--FILE--
<?php
require_once 'files/phar_oo_test.inc';
2007-12-14 18:54:54 +00:00
$fname = str_replace('\\', '/', $fname);
2006-03-04 18:46:51 +00:00
$it = new RecursiveDirectoryIterator('phar://'.$fname);
$it = new RecursiveIteratorIterator($it);
foreach($it as $name => $ent)
{
2007-12-14 05:22:53 +00:00
var_dump(str_replace(array('\\', $fname), array('/', '*'), $name));
var_dump(str_replace(array('\\', $fname), array('/', '*'), $ent->getPathname()));
2007-12-14 18:54:54 +00:00
var_dump(str_replace('\\', '/', $it->getSubPath()));
var_dump(str_replace('\\', '/', $it->getSubPathName()));
2006-03-04 18:46:51 +00:00
$sub = $it->getPathInfo();
2007-12-14 18:54:54 +00:00
var_dump(str_replace('\\', '/', $sub->getFilename()));
2006-03-04 18:46:51 +00:00
}
?>
===DONE===
--CLEAN--
<?php
2008-02-20 13:33:00 +00:00
unlink(dirname(__FILE__) . '/files/phar_oo_test.phar.php');
2006-03-04 18:46:51 +00:00
__halt_compiler();
?>
--EXPECT--
string(14) "phar://*/a.php"
string(14) "phar://*/a.php"
string(0) ""
2006-03-07 20:08:41 +00:00
string(5) "a.php"
string(5) "a.php"
2006-03-04 18:46:51 +00:00
string(16) "phar://*/b/c.php"
string(16) "phar://*/b/c.php"
string(1) "b"
2006-03-07 20:08:41 +00:00
string(7) "b/c.php"
string(5) "c.php"
2006-03-04 18:46:51 +00:00
string(16) "phar://*/b/d.php"
string(16) "phar://*/b/d.php"
string(1) "b"
2006-03-07 20:08:41 +00:00
string(7) "b/d.php"
string(5) "d.php"
2006-03-04 18:46:51 +00:00
string(14) "phar://*/b.php"
string(14) "phar://*/b.php"
string(0) ""
2006-03-07 20:08:41 +00:00
string(5) "b.php"
string(5) "b.php"
2006-03-04 18:46:51 +00:00
string(14) "phar://*/e.php"
string(14) "phar://*/e.php"
string(0) ""
2006-03-07 20:08:41 +00:00
string(5) "e.php"
string(5) "e.php"
2006-03-04 18:46:51 +00:00
===DONE===