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