1--TEST--
2Test dirname() function : error conditions
3--FILE--
4<?php
5/* Prototype: string dirname ( string $path );
6   Description: Returns directory name component of path.
7*/
8echo "*** Testing error conditions ***\n";
9// zero arguments
10var_dump( dirname() );
11
12// Bad arg
13var_dump( dirname("/var/tmp/bar.gz", 0) );
14
15// more than expected no. of arguments
16var_dump( dirname("/var/tmp/bar.gz", 1, ".gz") );
17
18echo "Done\n";
19?>
20--EXPECTF--
21*** Testing error conditions ***
22
23Warning: dirname() expects at least 1 parameter, 0 given in %s on line %d
24NULL
25
26Warning: dirname(): Invalid argument, levels must be >= 1 in %s on line %d
27NULL
28
29Warning: dirname() expects at most 2 parameters, 3 given in %s on line %d
30NULL
31Done
32