summaryrefslogtreecommitdiff
path: root/ext/zip/tests/utils.inc
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zip/tests/utils.inc')
-rw-r--r--ext/zip/tests/utils.inc24
1 files changed, 19 insertions, 5 deletions
diff --git a/ext/zip/tests/utils.inc b/ext/zip/tests/utils.inc
index c7cd2a8b0b..f44ab3af32 100644
--- a/ext/zip/tests/utils.inc
+++ b/ext/zip/tests/utils.inc
@@ -1,11 +1,25 @@
<?php
+function verify_entries($zip, $entries = []) {
+ $verified = true;
+ $found = [];
-function dump_entries_name($z) {
- for($i=0; $i<$z->numFiles; $i++) {
- $sb = $z->statIndex($i);
- echo $i . ' ' . $sb['name'] . "\n";
- }
+ for ($index = 0; $index < $zip->numFiles; $index++) {
+ $stat = $zip->statIndex($index);
+
+ if (!in_array($stat["name"], $entries)) {
+ $verified = false;
+ }
+
+ $found[] = $stat["name"];
+ }
+
+ if (!$verified) {
+ var_dump($found);
+ }
+
+ return $verified;
}
+
/* recursively remove a directoryy */
function rmdir_rf($dir) {
if ($handle = opendir($dir)) {