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