File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / streams / stream_resolve_include_path.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:04 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--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');

var_dump(stream_resolve_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'));

unlink($include_path_nested_file);
rmdir($include_path_nested);
unlink($include_path_file);
rmdir($include_path);
--EXPECTF--
Warning: stream_resolve_include_path() expects exactly 1 parameter, 0 given in %s on line %d
NULL
bool(false)
string(%d) "%stest_path%sfile"
string(%d) "%stest_path%snested%sfile"


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>