mirror of
https://github.com/php/php-src.git
synced 2026-03-30 20:22:36 +02:00
23 lines
436 B
PHP
23 lines
436 B
PHP
--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";
|
|
|
|
// Bad arg
|
|
try {
|
|
dirname("/var/tmp/bar.gz", 0);
|
|
} catch (\Error $e) {
|
|
echo $e->getMessage() . "\n";
|
|
}
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECTF--
|
|
*** Testing error conditions ***
|
|
Invalid argument, levels must be >= 1
|
|
Done
|