xref: /PHP-5.3/ext/phar/tests/rename.phpt (revision 228c2886)
1--TEST--
2Phar: rename 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$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
12$pname = 'phar://' . $fname;
13$file = "<?php
14Phar::mapPhar('hio');
15__HALT_COMPILER(); ?>";
16
17$files = array();
18$files['a'] = 'a';
19include 'files/phar_test.inc';
20include $fname;
21
22echo file_get_contents($pname . '/a') . "\n";
23rename($pname . '/a', $pname . '/b');
24echo file_get_contents($pname . '/b') . "\n";
25echo file_get_contents($pname . '/a') . "\n";
26?>
27--CLEAN--
28<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
29--EXPECTF--
30a
31a
32
33Warning: file_get_contents(phar://%srename.phar.php/a): failed to open stream: phar error: "a" is not a file in phar "%srename.phar.php" in %srename.php on line %d
34