xref: /PHP-5.3/ext/phar/tests/rename_dir.phpt (revision 228c2886)
1--TEST--
2Phar: rename_dir test
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--INI--
6phar.readonly=0
7phar.require_hash=0
8detect_unicode=0
9--FILE--
10<?php
11
12$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
13$pname = 'phar://' . $fname;
14$file = "<?php
15Phar::mapPhar('hio');
16__HALT_COMPILER(); ?>";
17
18$files = array();
19$files['a/x'] = 'a';
20include 'files/phar_test.inc';
21include $fname;
22
23echo file_get_contents($pname . '/a/x') . "\n";
24rename($pname . '/a', $pname . '/b');
25echo file_get_contents($pname . '/b/x') . "\n";
26echo file_get_contents($pname . '/a/x') . "\n";
27?>
28--CLEAN--
29<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
30--EXPECTF--
31a
32a
33
34Warning: 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
35