1--TEST--
2Test chdir() function : error conditions - Incorrect number of arguments
3--FILE--
4<?php
5/* Prototype  : bool chdir(string $directory)
6 * Description: Change the current directory
7 * Source code: ext/standard/dir.c
8 */
9
10/*
11 * Pass incorrect number of arguments to chdir() to test behaviour
12 */
13
14echo "*** Testing chdir() : error conditions ***\n";
15
16// Zero arguments
17echo "\n-- Testing chdir() function with Zero arguments --\n";
18var_dump( chdir() );
19
20//Test chdir with one more than the expected number of arguments
21echo "\n-- Testing chdir() function with more than expected no. of arguments --\n";
22$directory = __FILE__;
23$extra_arg = 10;
24var_dump( chdir($directory, $extra_arg) );
25?>
26===DONE===
27--EXPECTF--
28*** Testing chdir() : error conditions ***
29
30-- Testing chdir() function with Zero arguments --
31
32Warning: chdir() expects exactly 1 parameter, 0 given in %s on line %d
33bool(false)
34
35-- Testing chdir() function with more than expected no. of arguments --
36
37Warning: chdir() expects exactly 1 parameter, 2 given in %s on line %d
38bool(false)
39===DONE===
40