xref: /PHP-7.2/ext/phar/tests/017.phpt (revision 113213f0)
1--TEST--
2Phar: opendir test - no dir specified at all
3--SKIPIF--
4<?php
5if (!extension_loaded("phar")) die("skip");
6?>
7--INI--
8phar.require_hash=0
9--FILE--
10<?php
11$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
12$pname = 'phar://' . $fname;
13$file = "<?php
14Phar::mapPhar('hio');
15var_dump(__FILE__);
16var_dump(substr(__FILE__, 0, 4) != 'phar');
17__HALT_COMPILER(); ?>";
18
19$files = array();
20$files['a'] = 'abc';
21include 'files/phar_test.inc';
22
23include $pname;
24$dir = opendir('phar://hio');
25?>
26--CLEAN--
27<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
28--EXPECTF--
29string(%d) "%s017.phar.php"
30bool(true)
31
32Warning: 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)
33phar url "phar://hio" is unknown in %s017.php on line %d
34