]> granicus.if.org Git - php/commitdiff
- Add new test
authorMarcus Boerger <helly@php.net>
Sat, 4 Mar 2006 18:46:51 +0000 (18:46 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 4 Mar 2006 18:46:51 +0000 (18:46 +0000)
ext/phar/tests/phar_oo_005.phpt [new file with mode: 0755]

diff --git a/ext/phar/tests/phar_oo_005.phpt b/ext/phar/tests/phar_oo_005.phpt
new file mode 100755 (executable)
index 0000000..db5cc05
--- /dev/null
@@ -0,0 +1,50 @@
+--TEST--
+Phar and RecursiveDirectoryIterator
+--SKIPIF--
+<?php if (!extension_loaded("phar")) print "skip"; ?>
+--FILE--
+<?php
+
+require_once 'phar_oo_test.inc';
+
+$it = new RecursiveDirectoryIterator('phar://'.$fname);
+$it = new RecursiveIteratorIterator($it);
+
+foreach($it as $name => $ent)
+{
+       var_dump(str_replace($fname, '*', $name));
+       var_dump(str_replace($fname, '*', $ent->getPathname()));
+       var_dump($it->getSubPath());
+       $sub = $it->getPathInfo();
+       var_dump($sub->getFilename());
+}
+
+?>
+===DONE===
+--CLEAN--
+<?php 
+unlink(dirname(__FILE__) . '/phar_oo_test.phar.php');
+__halt_compiler();
+?>
+--EXPECT--
+string(14) "phar://*/a.php"
+string(14) "phar://*/a.php"
+string(0) ""
+string(21) "phar_oo_test.phar.php"
+string(16) "phar://*/b/c.php"
+string(16) "phar://*/b/c.php"
+string(1) "b"
+string(1) "b"
+string(16) "phar://*/b/d.php"
+string(16) "phar://*/b/d.php"
+string(1) "b"
+string(1) "b"
+string(14) "phar://*/b.php"
+string(14) "phar://*/b.php"
+string(0) ""
+string(21) "phar_oo_test.phar.php"
+string(14) "phar://*/e.php"
+string(14) "phar://*/e.php"
+string(0) ""
+string(21) "phar_oo_test.phar.php"
+===DONE===