odt.phpt 940 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Phar: test a zip archive created by openoffice
  3. --EXTENSIONS--
  4. phar
  5. zlib
  6. --FILE--
  7. <?php
  8. $a = new PharData(__DIR__ . '/files/odt.odt');
  9. foreach (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
  17. try {
  18. $b = new Phar(__DIR__ . '/files/odt.odt');
  19. } catch (Exception $e) {
  20. echo $e->getMessage() . "\n";
  21. }
  22. ?>
  23. --EXPECTF--
  24. phar://%sodt.odt/Configurations2/accelerator%ccurrent.xml
  25. phar://%sodt.odt/META-INF%cmanifest.xml
  26. phar://%sodt.odt/Thumbnails%cthumbnail.png
  27. phar://%sodt.odt%ccontent.xml
  28. phar://%sodt.odt%cmeta.xml
  29. phar://%sodt.odt%cmimetype
  30. phar://%sodt.odt%csettings.xml
  31. phar://%sodt.odt%cstyles.xml
  32. Cannot create phar '%sodt.odt', file extension (or combination) not recognised or the directory does not exist