blob: 1c724097b09429e20a7c9c71d7f4080c5f461d8f (
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
42
43
|
--TEST--
Test opendir() function : error conditions - Non-existent directory
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. Not valid for Windows');
}
?>
--FILE--
<?php
/* Prototype : mixed opendir(string $path[, resource $context])
* Description: Open a directory and return a dir_handle
* Source code: ext/standard/dir.c
*/
/*
* Pass a non-existent directory as $path argument to opendir() to test behaviour
*/
echo "*** Testing opendir() : error conditions ***\n";
echo "\n-- Pass a non-existent absolute path: --\n";
$path = dirname(__FILE__) . "/idonotexist";
var_dump(opendir($path));
echo "\n-- Pass a non-existent relative path: --\n";
chdir(dirname(__FILE__));
var_dump(opendir('idonotexist'));
?>
===DONE===
--EXPECTF--
*** Testing opendir() : error conditions ***
-- Pass a non-existent absolute path: --
Warning: opendir(%s/idonotexist): failed to open dir: %s in %s on line %d
bool(false)
-- Pass a non-existent relative path: --
Warning: opendir(idonotexist): failed to open dir: %s in %s on line %d
bool(false)
===DONE===
|