xref: /PHP-7.3/ext/phar/tests/zip/unixzip.phpt (revision 84488d92)
1--TEST--
2Phar: test a zip archive created by unix "zip" command
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--FILE--
6<?php
7$a = new PharData(dirname(__FILE__) . '/files/zip.zip');
8foreach ($a as $b) {
9	if ($b->isDir()) {
10		echo "dir " . $b->getPathName() . "\n";
11	} else {
12		echo $b->getPathName(), "\n";
13		echo file_get_contents($b->getPathName()), "\n";
14	}
15}
16if (isset($a['notempty/hi.txt'])) {
17	echo $a['notempty/hi.txt']->getPathName() . "\n";
18}
19?>
20===DONE===
21--EXPECTF--
22dir phar://%s/zip.zip%cempty
23phar://%s/zip.zip%chi.txt
24hi there
25
26dir phar://%s/zip.zip%cnotempty
27phar://%s/zip.zip/notempty%chi.txt
28===DONE===
29