xref: /PHP-5.4/ext/phar/tests/017.phpt (revision 377ff97a)
1--TEST--
2Phar: opendir test - no dir specified at all
3--SKIPIF--
4<?php
5if (!extension_loaded("phar")) die("skip");
6if (version_compare(PHP_VERSION, "6.0", ">")) die("skip pre-unicode version of PHP required");
7?>
8--INI--
9phar.require_hash=0
10--FILE--
11<?php
12$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
13$pname = 'phar://' . $fname;
14$file = "<?php
15Phar::mapPhar('hio');
16var_dump(__FILE__);
17var_dump(substr(__FILE__, 0, 4) != 'phar');
18__HALT_COMPILER(); ?>";
19
20$files = array();
21$files['a'] = 'abc';
22include 'files/phar_test.inc';
23
24include $pname;
25$dir = opendir('phar://hio');
26?>
27--CLEAN--
28<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
29--EXPECTF--
30string(%d) "%s017.phar.php"
31bool(true)
32
33Warning: opendir(phar://hio): failed to open dir: phar error: no directory in "phar://hio", must have at least phar://hio/ for root directory (always use full path to a new phar)
34phar url "phar://hio" is unknown in %s017.php on line %d