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