blob: 21eaad4b067c131298961c4fb38e3fd43b117c7d (
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
44
45
46
47
48
49
|
--TEST--
Test readdir() function : error conditions - Incorrect number of args
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) != 'WIN') {
die("skip Valid only on Windows");
}
?>
--FILE--
<?php
/* Prototype : string readdir([resource $dir_handle])
* Description: Read directory entry from dir_handle
* Source code: ext/standard/dir.c
*/
/*
* Pass incorrect number of arguments to readdir() to test behaviour
*/
echo "*** Testing readdir() : error conditions ***\n";
//Test readdir with one more than the expected number of arguments
echo "\n-- Testing readdir() function with more than expected no. of arguments --\n";
$path = dirname(__FILE__) . "/私はガラスを食べられますreaddir_error";
mkdir($path);
$dir_handle = opendir($path);
$extra_arg = 10;
var_dump( readdir($dir_handle, $extra_arg) );
// close the handle so can remove dir in CLEAN section
closedir($dir_handle);
?>
===DONE===
--CLEAN--
<?php
$path = dirname(__FILE__) . "/私はガラスを食べられますreaddir_error";
rmdir($path);
?>
--EXPECTF--
*** Testing readdir() : error conditions ***
-- Testing readdir() function with more than expected no. of arguments --
Warning: readdir() expects at most 1 parameter, 2 given in %s on line %d
NULL
===DONE===
|