Annotation of embedaddon/php/ext/standard/tests/streams/stream_resolve_include_path.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: stream_resolve_include_path(string path)
3: --FILE--
4: <?php
5: $include_path = __DIR__ . '/test_path';
6: $include_path_nested = $include_path . '/nested';
7:
8: $include_path_file = $include_path . DIRECTORY_SEPARATOR . 'file';
9: $include_path_nested_file = $include_path_nested . DIRECTORY_SEPARATOR . 'file';
10:
11: mkdir($include_path);
12: mkdir($include_path_nested);
13:
14: file_put_contents($include_path_file, 'include_path');
15: file_put_contents($include_path_nested_file, 'include_path');
16:
17: var_dump(stream_resolve_include_path());
18:
19: set_include_path($include_path . PATH_SEPARATOR . $include_path_nested);
20: var_dump(stream_resolve_include_path('file-does-not-exist'));
21:
22: set_include_path($include_path . PATH_SEPARATOR . $include_path_nested);
23: var_dump(stream_resolve_include_path('file'));
24: set_include_path($include_path_nested . PATH_SEPARATOR . $include_path);
25: var_dump(stream_resolve_include_path('file'));
26:
27: unlink($include_path_nested_file);
28: rmdir($include_path_nested);
29: unlink($include_path_file);
30: rmdir($include_path);
31: --EXPECTF--
32: Warning: stream_resolve_include_path() expects exactly 1 parameter, 0 given in %s on line %d
33: NULL
34: bool(false)
35: string(%d) "%stest_path%sfile"
36: string(%d) "%stest_path%snested%sfile"
37:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>