summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/dirname_error.phpt
blob: 98a9ea5b4567190c4a23e1a72b0bf20413208934 (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
--TEST--
Test dirname() function : error conditions
--FILE--
<?php
/* Prototype: string dirname ( string $path );
   Description: Returns directory name component of path.
*/
echo "*** Testing error conditions ***\n";
// zero arguments
var_dump( dirname() );

// Bad arg
var_dump( dirname("/var/tmp/bar.gz", 0) );

// more than expected no. of arguments
var_dump( dirname("/var/tmp/bar.gz", 1, ".gz") );

echo "Done\n";
?>
--EXPECTF--
*** Testing error conditions ***

Warning: dirname() expects at least 1 parameter, 0 given in %s on line %d
NULL

Warning: dirname(): Invalid argument, levels must be >= 1 in %s on line %d
NULL

Warning: dirname() expects at most 2 parameters, 3 given in %s on line %d
NULL
Done