1--TEST--
2Test scandir() function : error conditions - Non-existent directory
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) == 'WIN') {
6    die('skip.. Not valid for Windows');
7}
8?>
9--FILE--
10<?php
11/*
12 * Pass a directory that does not exist to scandir() to test error messages
13 */
14
15echo "*** Testing scandir() : error conditions ***\n";
16
17$directory = __DIR__ . '/idonotexist';
18
19echo "\n-- Pass scandir() an absolute path that does not exist --\n";
20var_dump(scandir($directory));
21
22echo "\n-- Pass scandir() a relative path that does not exist --\n";
23var_dump(scandir('/idonotexist'));
24?>
25--EXPECTF--
26*** Testing scandir() : error conditions ***
27
28-- Pass scandir() an absolute path that does not exist --
29
30Warning: scandir(%s/idonotexist): Failed to open directory: %s in %s on line %d
31
32Warning: scandir(): (errno %d): %s in %s on line %d
33bool(false)
34
35-- Pass scandir() a relative path that does not exist --
36
37Warning: scandir(/idonotexist): Failed to open directory: %s in %s on line %d
38
39Warning: scandir(): (errno %d): %s in %s on line %d
40bool(false)
41