summaryrefslogtreecommitdiff
path: root/ext/standard/tests/streams/stream_resolve_include_path.phpt
blob: f77c0730f3d53ca83a3263cd1eb00c32f986b7a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--TEST--
stream_resolve_include_path(string path)
--FILE--
<?php
$include_path = __DIR__ . '/test_path';
$include_path_nested = $include_path . '/nested';

$include_path_file = $include_path . DIRECTORY_SEPARATOR . 'file';
$include_path_nested_file = $include_path_nested . DIRECTORY_SEPARATOR . 'file';

mkdir($include_path);
mkdir($include_path_nested);

file_put_contents($include_path_file, 'include_path');
file_put_contents($include_path_nested_file, 'include_path');

set_include_path($include_path . PATH_SEPARATOR . $include_path_nested);
var_dump(stream_resolve_include_path('file-does-not-exist'));

set_include_path($include_path . PATH_SEPARATOR . $include_path_nested);
var_dump(stream_resolve_include_path('file'));
set_include_path($include_path_nested . PATH_SEPARATOR . $include_path);
var_dump(stream_resolve_include_path('file'));

?>
--CLEAN--
<?php
$include_path = __DIR__ . '/test_path';
$include_path_nested = $include_path . '/nested';
$include_path_file = $include_path . DIRECTORY_SEPARATOR . 'file';
$include_path_nested_file = $include_path_nested . DIRECTORY_SEPARATOR . 'file';

unlink($include_path_nested_file);
rmdir($include_path_nested);
unlink($include_path_file);
rmdir($include_path);
?>
--EXPECTF--
bool(false)
string(%d) "%stest_path%sfile"
string(%d) "%stest_path%snested%sfile"