xref: /PHP-7.1/ext/phar/tests/017U.phpt (revision e3de409e)
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 Unicode support 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 = b"<?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--
30unicode(%d) "%s017U.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 %s017U.php on line %d
35