summaryrefslogtreecommitdiff
path: root/ext/phar/tests/zip/unixzip.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/phar/tests/zip/unixzip.phpt')
-rw-r--r--ext/phar/tests/zip/unixzip.phpt29
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/phar/tests/zip/unixzip.phpt b/ext/phar/tests/zip/unixzip.phpt
new file mode 100644
index 0000000..e2b95be
--- /dev/null
+++ b/ext/phar/tests/zip/unixzip.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Phar: test a zip archive created by unix "zip" command
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
+--FILE--
+<?php
+$a = new PharData(dirname(__FILE__) . '/files/zip.zip');
+foreach ($a as $b) {
+ if ($b->isDir()) {
+ echo "dir " . $b->getPathName() . "\n";
+ } else {
+ echo $b->getPathName(), "\n";
+ echo file_get_contents($b->getPathName()), "\n";
+ }
+}
+if (isset($a['notempty/hi.txt'])) {
+ echo $a['notempty/hi.txt']->getPathName() . "\n";
+}
+?>
+===DONE===
+--EXPECTF--
+dir phar://%s/zip.zip%cempty
+phar://%s/zip.zip%chi.txt
+hi there
+
+dir phar://%s/zip.zip%cnotempty
+phar://%s/zip.zip/notempty%chi.txt
+===DONE===