Annotation of embedaddon/php/ext/standard/tests/file/mkdir_rmdir_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test 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:
! 12: echo "*** Testing mkdir(): error conditions ***\n";
! 13: var_dump( mkdir() ); // args < expected
! 14: var_dump( mkdir(1, 2, 3, 4, 5) ); // args > expected
! 15: var_dump( mkdir("testdir", 0777, false, $context, "test") ); // args > expected
! 16:
! 17: echo "\n*** Testing rmdir(): error conditions ***\n";
! 18: var_dump( rmdir() ); // args < expected
! 19: var_dump( rmdir(1, 2, 3) ); // args > expected
! 20: var_dump( rmdir("testdir", $context, "test") ); // args > expected
! 21:
! 22: echo "\n*** Testing rmdir() on non-existent directory ***\n";
! 23: var_dump( rmdir("temp") );
! 24:
! 25: echo "Done\n";
! 26: ?>
! 27: --EXPECTF--
! 28: *** Testing mkdir(): error conditions ***
! 29:
! 30: Warning: mkdir() expects at least 1 parameter, 0 given in %s on line %d
! 31: bool(false)
! 32:
! 33: Warning: mkdir() expects at most 4 parameters, 5 given in %s on line %d
! 34: bool(false)
! 35:
! 36: Notice: Undefined variable: context in %s on line %d
! 37:
! 38: Warning: mkdir() expects at most 4 parameters, 5 given in %s on line %d
! 39: bool(false)
! 40:
! 41: *** Testing rmdir(): error conditions ***
! 42:
! 43: Warning: rmdir() expects at least 1 parameter, 0 given in %s on line %d
! 44: bool(false)
! 45:
! 46: Warning: rmdir() expects at most 2 parameters, 3 given in %s on line %d
! 47: bool(false)
! 48:
! 49: Notice: Undefined variable: context in %s on line %d
! 50:
! 51: Warning: rmdir() expects at most 2 parameters, 3 given in %s on line %d
! 52: bool(false)
! 53:
! 54: *** Testing rmdir() on non-existent directory ***
! 55:
! 56: Warning: rmdir(temp): No such file or directory in %s on line %d
! 57: bool(false)
! 58: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>