Annotation of embedaddon/php/ext/standard/tests/file/is_writable_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test is_writable() and its alias is_writeable() function: error conditions
! 3: --FILE--
! 4: <?php
! 5: /* Prototype: bool is_writable ( string $filename );
! 6: Description: Tells whether the filename is writable.
! 7:
! 8: is_writeable() is an alias of is_writable()
! 9: */
! 10:
! 11: echo "*** Testing is_writable(): error conditions ***\n";
! 12: var_dump( is_writable() ); // args < expected
! 13: var_dump( is_writeable() );
! 14:
! 15: echo "\n*** Testing is_writeable(): error conditions ***\n";
! 16: var_dump( is_writable(1, 2) ); // args > expected
! 17: var_dump( is_writeable(1, 2) );
! 18:
! 19: echo "\n*** Testing is_writable() on non-existent file ***\n";
! 20: var_dump( is_writable(dirname(__FILE__)."/is_writable") );
! 21: var_dump( is_writeable(dirname(__FILE__)."/is_writable") );
! 22:
! 23: echo "Done\n";
! 24: ?>
! 25: --EXPECTF--
! 26: *** Testing is_writable(): error conditions ***
! 27:
! 28: Warning: is_writable() expects exactly 1 parameter, 0 given in %s on line %d
! 29: NULL
! 30:
! 31: Warning: is_writeable() expects exactly 1 parameter, 0 given in %s on line %d
! 32: NULL
! 33:
! 34: *** Testing is_writeable(): error conditions ***
! 35:
! 36: Warning: is_writable() expects exactly 1 parameter, 2 given in %s on line %d
! 37: NULL
! 38:
! 39: Warning: is_writeable() expects exactly 1 parameter, 2 given in %s on line %d
! 40: NULL
! 41:
! 42: *** Testing is_writable() on non-existent file ***
! 43: bool(false)
! 44: bool(false)
! 45: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>