diff options
Diffstat (limited to 'ext/phar/tests/rename_dir.phpt')
-rw-r--r-- | ext/phar/tests/rename_dir.phpt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/phar/tests/rename_dir.phpt b/ext/phar/tests/rename_dir.phpt new file mode 100644 index 0000000..d19a37f --- /dev/null +++ b/ext/phar/tests/rename_dir.phpt @@ -0,0 +1,33 @@ +--TEST-- +Phar: rename_dir test +--SKIPIF-- +<?php if (!extension_loaded("phar")) die("skip"); ?> +--INI-- +phar.readonly=0 +phar.require_hash=0 +--FILE-- +<?php + +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; +$pname = 'phar://' . $fname; +$file = "<?php +Phar::mapPhar('hio'); +__HALT_COMPILER(); ?>"; + +$files = array(); +$files['a/x'] = 'a'; +include 'files/phar_test.inc'; +include $fname; + +echo file_get_contents($pname . '/a/x') . "\n"; +rename($pname . '/a', $pname . '/b'); +echo file_get_contents($pname . '/b/x') . "\n"; +echo file_get_contents($pname . '/a/x') . "\n"; +?> +--CLEAN-- +<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> +--EXPECTF-- +a +a + +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 |