1--TEST-- 2Test mkdir() and rmdir() functions : error conditions 3--FILE-- 4<?php 5/* Prototype: bool mkdir ( string $pathname [, int $mode [, bool $recursive [, resource $context]]] ); 6 Description: Makes directory 7 8 Prototype: bool rmdir ( string $dirname [, resource $context] ); 9 Description: Removes directory 10*/ 11 12echo "*** Testing mkdir(): error conditions ***\n"; 13var_dump( mkdir() ); // args < expected 14var_dump( mkdir(1, 2, 3, 4, 5) ); // args > expected 15var_dump( mkdir("testdir", 0777, false, $context, "test") ); // args > expected 16 17echo "\n*** Testing rmdir(): error conditions ***\n"; 18var_dump( rmdir() ); // args < expected 19var_dump( rmdir(1, 2, 3) ); // args > expected 20var_dump( rmdir("testdir", $context, "test") ); // args > expected 21 22echo "\n*** Testing rmdir() on non-existent directory ***\n"; 23var_dump( rmdir("temp") ); 24 25echo "Done\n"; 26?> 27--EXPECTF-- 28*** Testing mkdir(): error conditions *** 29 30Warning: mkdir() expects at least 1 parameter, 0 given in %s on line %d 31bool(false) 32 33Warning: mkdir() expects at most 4 parameters, 5 given in %s on line %d 34bool(false) 35 36Notice: Undefined variable: context in %s on line %d 37 38Warning: mkdir() expects at most 4 parameters, 5 given in %s on line %d 39bool(false) 40 41*** Testing rmdir(): error conditions *** 42 43Warning: rmdir() expects at least 1 parameter, 0 given in %s on line %d 44bool(false) 45 46Warning: rmdir() expects at most 2 parameters, 3 given in %s on line %d 47bool(false) 48 49Notice: Undefined variable: context in %s on line %d 50 51Warning: rmdir() expects at most 2 parameters, 3 given in %s on line %d 52bool(false) 53 54*** Testing rmdir() on non-existent directory *** 55 56Warning: rmdir(temp): No such file or directory in %s on line %d 57bool(false) 58Done 59