xref: /PHP-5.3/ext/phar/tests/rmdir.phpt (revision 228c2886)
1--TEST--
2Phar: rmdir 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 = b"<?php
14Phar::mapPhar('hio');
15__HALT_COMPILER(); ?>";
16
17$files = array();
18$files['a/x'] = 'a';
19include 'files/phar_test.inc';
20include $fname;
21
22echo file_get_contents($pname . '/a/x') . "\n";
23var_dump(rmdir($pname . '/a'));
24echo file_get_contents($pname . '/a/x') . "\n";
25unlink($pname . '/a/x');
26var_dump(rmdir($pname . '/a'));
27?>
28--CLEAN--
29<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
30--EXPECTF--
31a
32
33Warning: rmdir(): phar error: Directory not empty in %srmdir.php on line 14
34bool(false)
35a
36bool(true)
37