xref: /PHP-8.0/ext/phar/tests/zip/odt.phpt (revision f8d79582)
1--TEST--
2Phar: test a zip archive created by openoffice
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5<?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
6--FILE--
7<?php
8$a = new PharData(__DIR__ . '/files/odt.odt');
9foreach (new RecursiveIteratorIterator($a, RecursiveIteratorIterator::LEAVES_ONLY) as $b) {
10    if ($b->isDir()) {
11        echo "dir " . $b->getPathName() . "\n";
12    } else {
13        echo $b->getPathName() . "\n";
14    }
15}
16// this next line is for increased code coverage
17try {
18    $b = new Phar(__DIR__ . '/files/odt.odt');
19} catch (Exception $e) {
20    echo $e->getMessage() . "\n";
21}
22?>
23--EXPECTF--
24phar://%sodt.odt/Configurations2/accelerator%ccurrent.xml
25phar://%sodt.odt/META-INF%cmanifest.xml
26phar://%sodt.odt/Thumbnails%cthumbnail.png
27phar://%sodt.odt%ccontent.xml
28phar://%sodt.odt%cmeta.xml
29phar://%sodt.odt%cmimetype
30phar://%sodt.odt%csettings.xml
31phar://%sodt.odt%cstyles.xml
32Cannot create phar '%sodt.odt', file extension (or combination) not recognised or the directory does not exist
33