xref: /PHP-7.4/ext/phar/tests/include_path.phpt (revision 15b394cc)
1--TEST--
2Phar: include_path with phar:// wrapper
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--CONFLICTS--
6tempmanifest1.phar.php
7--INI--
8phar.readonly=0
9--FILE--
10<?php
11$fname = __DIR__ . '/tempmanifest1.phar.php';
12$a = new Phar($fname);
13$a['file1.php'] = 'file1.php
14';
15$a['test/file1.php'] = 'test/file1.php
16';
17unset($a);
18set_include_path('.' . PATH_SEPARATOR . 'phar://' . $fname);
19include 'file1.php';
20set_include_path('.' . PATH_SEPARATOR . 'phar://' . $fname . '/test');
21include 'file1.php';
22include 'file2.php';
23?>
24===DONE===
25--CLEAN--
26<?php
27@unlink(__DIR__ . '/tempmanifest1.phar.php');
28?>
29--EXPECTF--
30file1.php
31test/file1.php
32
33Warning: include(file2.php): failed to open stream: No such file or directory in %sinclude_path.php on line %d
34
35Warning: include(): Failed opening 'file2.php' for inclusion (include_path='%sphar://%stempmanifest1.phar.php/test') in %sinclude_path.php on line %d
36===DONE===
37