xref: /PHP-8.4/ext/phar/tests/zip/unixzip.phpt (revision 74859783)
1--TEST--
2Phar: test a zip archive created by unix "zip" command
3--EXTENSIONS--
4phar
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