Annotation of embedaddon/php/ext/standard/tests/file/copy_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test copy() function: error conditions
! 3: --FILE--
! 4: <?php
! 5: /* Prototype: bool copy ( string $source, string $dest );
! 6: * Description: Makes a copy of the file source to dest.
! 7: * Returns TRUE on success or FALSE on failure.
! 8: */
! 9:
! 10: echo "*** Testing copy() function: error conditions --\n";
! 11: /* Invalid args */
! 12: var_dump( copy("/no/file", "file") );
! 13:
! 14: /* No.of args less than expected */
! 15: var_dump( copy() );
! 16: var_dump( copy(__FILE__) );
! 17:
! 18: /* No.of args less than expected */
! 19: var_dump( copy(__FILE__, "file1", "file1") );
! 20:
! 21: echo "*** Done ***\n";
! 22: ?>
! 23:
! 24: --EXPECTF--
! 25: *** Testing copy() function: error conditions --
! 26:
! 27: Warning: copy(/no/file): failed to open stream: No such file or directory in %s on line %d
! 28: bool(false)
! 29:
! 30: Warning: copy() expects at least 2 parameters, 0 given in %s on line %d
! 31: NULL
! 32:
! 33: Warning: copy() expects at least 2 parameters, 1 given in %s on line %d
! 34: NULL
! 35:
! 36: Warning: copy() expects parameter 3 to be resource, string given in %s on line %d
! 37: NULL
! 38: *** Done ***
! 39:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>