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