Annotation of embedaddon/php/ext/phar/tests/zip/rmdir.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: rmdir test zip-based
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: --INI--
6: phar.readonly=0
7: phar.require_hash=0
8: --FILE--
9: <?php
10:
11: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip';
12: $alias = 'phar://' . $fname;
13:
14: $phar = new Phar($fname);
15: $phar->setStub("<?php
16: Phar::mapPhar('hio');
17: __HALT_COMPILER(); ?>");
18: $phar->addEmptyDir('a');
19: $phar['a/x'] = 'a';
20: $phar->stopBuffering();
21:
22: include $fname;
23:
24: echo file_get_contents($alias . '/a/x') . "\n";
25: var_dump(rmdir($alias . '/a'));
26: echo file_get_contents($alias . '/a/x') . "\n";
27: unlink($alias . '/a/x');
28: var_dump(rmdir($alias . '/a'));
29: ?>
30: --CLEAN--
31: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?>
32: --EXPECTF--
33: a
34:
35: Warning: rmdir(): phar error: Directory not empty in %srmdir.php on line %d
36: bool(false)
37: a
38: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>