Annotation of embedaddon/php/ext/standard/tests/dir/opendir_error2.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Test opendir() function : error conditions - Non-existent directory
1.1.1.2 ! misho 3: --SKIPIF--
! 4: <?php
! 5: if (substr(PHP_OS, 0, 3) == 'WIN') {
! 6: die('skip.. Not valid for Windows');
! 7: }
! 8: ?>
1.1 misho 9: --FILE--
10: <?php
11: /* Prototype : mixed opendir(string $path[, resource $context])
12: * Description: Open a directory and return a dir_handle
13: * Source code: ext/standard/dir.c
14: */
15:
16: /*
17: * Pass a non-existent directory as $path argument to opendir() to test behaviour
18: */
19:
20: echo "*** Testing opendir() : error conditions ***\n";
21:
22: echo "\n-- Pass a non-existent absolute path: --\n";
23: $path = dirname(__FILE__) . "/idonotexist";
24: var_dump(opendir($path));
25:
26: echo "\n-- Pass a non-existent relative path: --\n";
27: chdir(dirname(__FILE__));
28: var_dump(opendir('idonotexist'));
29: ?>
30: ===DONE===
31: --EXPECTF--
32: *** Testing opendir() : error conditions ***
33:
34: -- Pass a non-existent absolute path: --
35:
36: Warning: opendir(%s/idonotexist): failed to open dir: %s in %s on line %d
37: bool(false)
38:
39: -- Pass a non-existent relative path: --
40:
41: Warning: opendir(idonotexist): failed to open dir: %s in %s on line %d
42: bool(false)
43: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>