]> granicus.if.org Git - php/commitdiff
add new test for openoffice-created zip
authorGreg Beaver <cellog@php.net>
Sun, 20 Apr 2008 05:22:02 +0000 (05:22 +0000)
committerGreg Beaver <cellog@php.net>
Sun, 20 Apr 2008 05:22:02 +0000 (05:22 +0000)
ext/phar/tests/zip/files/odt.odt [new file with mode: 0644]
ext/phar/tests/zip/odt.phpt [new file with mode: 0644]

diff --git a/ext/phar/tests/zip/files/odt.odt b/ext/phar/tests/zip/files/odt.odt
new file mode 100644 (file)
index 0000000..527e09f
Binary files /dev/null and b/ext/phar/tests/zip/files/odt.odt differ
diff --git a/ext/phar/tests/zip/odt.phpt b/ext/phar/tests/zip/odt.phpt
new file mode 100644 (file)
index 0000000..9901c21
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+Phar: test a zip archive created by openoffice
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
+--FILE--
+<?php
+$a = new PharData(dirname(__FILE__) . '/files/odt.odt');
+foreach (new RecursiveIteratorIterator($a, RecursiveIteratorIterator::LEAVES_ONLY) as $b) {
+       if ($b->isDir()) {
+               echo "dir " . $b->getPathName() . "\n";
+       } else {
+               echo $b->getPathName() . "\n";
+       }
+}
+?>
+===DONE===
+--EXPECTF--
+phar://%sodt.odt%cConfigurations2%caccelerator%ccurrent.xml
+phar://%sodt.odt%cMETA-INF%cmanifest.xml
+phar://%sodt.odt%cThumbnails%cthumbnail.png
+phar://%sodt.odt%ccontent.xml
+phar://%sodt.odt%cmeta.xml
+phar://%sodt.odt%cmimetype
+phar://%sodt.odt%csettings.xml
+phar://%sodt.odt%cstyles.xml
+===DONE===