summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2006-03-07 20:08:41 +0000
committerMarcus Boerger <helly@php.net>2006-03-07 20:08:41 +0000
commita616c42ae4ba7663b593b1463dca81000558efe1 (patch)
tree2cc30b62a7421eac53100cb9493bcc0495c75fec
parentf8448b426d4e378fd4745c908bebf2e22a32b902 (diff)
downloadphp-git-a616c42ae4ba7663b593b1463dca81000558efe1.tar.gz
- Update tests
-rwxr-xr-xext/phar/tests/phar_oo_004.phpt84
-rwxr-xr-xext/phar/tests/phar_oo_005.phpt6
2 files changed, 90 insertions, 0 deletions
diff --git a/ext/phar/tests/phar_oo_004.phpt b/ext/phar/tests/phar_oo_004.phpt
index 590735881d..561ff5f093 100755
--- a/ext/phar/tests/phar_oo_004.phpt
+++ b/ext/phar/tests/phar_oo_004.phpt
@@ -14,6 +14,58 @@ foreach($it as $name => $ent)
var_dump($name);
var_dump($ent->getFilename());
var_dump($ent->isDir());
+ var_dump($ent->isDot());
+}
+
+?>
+===MANUAL===
+<?php
+
+class MyDirectoryIterator extends DirectoryIterator
+{
+ function __construct($dir)
+ {
+ echo __METHOD__ . "\n";
+ parent::__construct($dir);
+ }
+
+ function rewind()
+ {
+ echo __METHOD__ . "\n";
+ parent::rewind();
+ }
+
+ function valid()
+ {
+ echo __METHOD__ . "\n";
+ return parent::valid();
+ }
+
+ function key()
+ {
+ echo __METHOD__ . "\n";
+ return parent::key();
+ }
+
+ function current()
+ {
+ echo __METHOD__ . "\n";
+ return parent::current();
+ }
+
+ function next()
+ {
+ echo __METHOD__ . "\n";
+ parent::next();
+ }
+}
+
+$it = new MyDirectoryIterator('phar://'.$fname);
+
+foreach($it as $name => $ent)
+{
+ var_dump($name);
+ var_dump($ent->getFilename());
}
?>
@@ -27,13 +79,45 @@ __halt_compiler();
int(0)
string(5) "a.php"
bool(false)
+bool(false)
int(1)
string(1) "b"
bool(true)
+bool(false)
int(2)
string(5) "b.php"
bool(false)
+bool(false)
int(3)
string(5) "e.php"
bool(false)
+bool(false)
+===MANUAL===
+MyDirectoryIterator::__construct
+MyDirectoryIterator::rewind
+MyDirectoryIterator::valid
+MyDirectoryIterator::current
+MyDirectoryIterator::key
+int(0)
+string(5) "a.php"
+MyDirectoryIterator::next
+MyDirectoryIterator::valid
+MyDirectoryIterator::current
+MyDirectoryIterator::key
+int(1)
+string(1) "b"
+MyDirectoryIterator::next
+MyDirectoryIterator::valid
+MyDirectoryIterator::current
+MyDirectoryIterator::key
+int(2)
+string(5) "b.php"
+MyDirectoryIterator::next
+MyDirectoryIterator::valid
+MyDirectoryIterator::current
+MyDirectoryIterator::key
+int(3)
+string(5) "e.php"
+MyDirectoryIterator::next
+MyDirectoryIterator::valid
===DONE===
diff --git a/ext/phar/tests/phar_oo_005.phpt b/ext/phar/tests/phar_oo_005.phpt
index db5cc057c1..167bee73ad 100755
--- a/ext/phar/tests/phar_oo_005.phpt
+++ b/ext/phar/tests/phar_oo_005.phpt
@@ -15,6 +15,7 @@ foreach($it as $name => $ent)
var_dump(str_replace($fname, '*', $name));
var_dump(str_replace($fname, '*', $ent->getPathname()));
var_dump($it->getSubPath());
+ var_dump($it->getSubPathName());
$sub = $it->getPathInfo();
var_dump($sub->getFilename());
}
@@ -30,21 +31,26 @@ __halt_compiler();
string(14) "phar://*/a.php"
string(14) "phar://*/a.php"
string(0) ""
+string(5) "a.php"
string(21) "phar_oo_test.phar.php"
string(16) "phar://*/b/c.php"
string(16) "phar://*/b/c.php"
string(1) "b"
+string(7) "b/c.php"
string(1) "b"
string(16) "phar://*/b/d.php"
string(16) "phar://*/b/d.php"
string(1) "b"
+string(7) "b/d.php"
string(1) "b"
string(14) "phar://*/b.php"
string(14) "phar://*/b.php"
string(0) ""
+string(5) "b.php"
string(21) "phar_oo_test.phar.php"
string(14) "phar://*/e.php"
string(14) "phar://*/e.php"
string(0) ""
+string(5) "e.php"
string(21) "phar_oo_test.phar.php"
===DONE===