xref: /PHP-7.4/ext/phar/tests/zip/odt.phpt (revision 26dfce7f)
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===DONE===
24--EXPECTF--
25phar://%sodt.odt/Configurations2/accelerator%ccurrent.xml
26phar://%sodt.odt/META-INF%cmanifest.xml
27phar://%sodt.odt/Thumbnails%cthumbnail.png
28phar://%sodt.odt%ccontent.xml
29phar://%sodt.odt%cmeta.xml
30phar://%sodt.odt%cmimetype
31phar://%sodt.odt%csettings.xml
32phar://%sodt.odt%cstyles.xml
33Cannot create phar '%sodt.odt', file extension (or combination) not recognised or the directory does not exist
34===DONE===
35