1--TEST--
2Test readlink() and realpath() functions: error conditions
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) != 'WIN') {
6    die('skip only for Windows');
7}
8?>
9--FILE--
10<?php
11echo "\n*** Testing readlink() on a non-existent link ***\n";
12var_dump( readlink(__DIR__."/readlink_error.tmp") );
13
14echo "\n*** Testing readlink() on existing file ***\n";
15var_dump( readlink(__FILE__) );
16
17echo "\n*** Testing readlink() on existing directory ***\n";
18var_dump( readlink(__DIR__) );
19
20echo "\n*** Testing realpath() on a non-existent file ***\n";
21var_dump( realpath(__DIR__."/realpath_error.tmp") );
22
23echo "Done\n";
24?>
25--EXPECTF--
26*** Testing readlink() on a non-existent link ***
27
28Warning: readlink(): readlink failed to read the symbolic link (%s, error %d) in %s on line %d
29bool(false)
30
31*** Testing readlink() on existing file ***
32string(%d) "%s%eext%estandard%etests%efile%ereadlink_realpath_error-win32.php"
33
34*** Testing readlink() on existing directory ***
35string(%d) "%s%eext%estandard%etests%efile"
36
37*** Testing realpath() on a non-existent file ***
38%s
39Done
40