xref: /PHP-8.0/ext/phar/tests/zip/unixzip.phpt (revision f8d79582)
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(__DIR__ . '/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--EXPECTF--
21dir phar://%s/zip.zip%cempty
22phar://%s/zip.zip%chi.txt
23hi there
24
25dir phar://%s/zip.zip%cnotempty
26phar://%s/zip.zip/notempty%chi.txt
27