rename_dir.phpt 829 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Phar: rename_dir test
  3. --EXTENSIONS--
  4. phar
  5. --INI--
  6. phar.readonly=0
  7. phar.require_hash=0
  8. --FILE--
  9. <?php
  10. $fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
  11. $pname = 'phar://' . $fname;
  12. $file = "<?php
  13. Phar::mapPhar('hio');
  14. __HALT_COMPILER(); ?>";
  15. $files = array();
  16. $files['a/x'] = 'a';
  17. include 'files/phar_test.inc';
  18. include $fname;
  19. echo file_get_contents($pname . '/a/x') . "\n";
  20. rename($pname . '/a', $pname . '/b');
  21. echo file_get_contents($pname . '/b/x') . "\n";
  22. echo file_get_contents($pname . '/a/x') . "\n";
  23. ?>
  24. --CLEAN--
  25. <?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
  26. --EXPECTF--
  27. a
  28. a
  29. Warning: file_get_contents(phar://%srename_dir.phar.php/a/x): Failed to open stream: phar error: "a/x" is not a file in phar "%srename_dir.phar.php" in %srename_dir.php on line %d