1--TEST-- 2Test 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 10echo "*** Testing copy() function: error conditions --\n"; 11/* Invalid args */ 12var_dump( copy("/no/file", "file") ); 13 14/* No.of args less than expected */ 15var_dump( copy() ); 16var_dump( copy(__FILE__) ); 17 18/* No.of args less than expected */ 19var_dump( copy(__FILE__, "file1", "file1") ); 20 21echo "*** Done ***\n"; 22?> 23 24--EXPECTF-- 25*** Testing copy() function: error conditions -- 26 27Warning: copy(/no/file): failed to open stream: No such file or directory in %s on line %d 28bool(false) 29 30Warning: copy() expects at least 2 parameters, 0 given in %s on line %d 31NULL 32 33Warning: copy() expects at least 2 parameters, 1 given in %s on line %d 34NULL 35 36Warning: copy() expects parameter 3 to be resource, string given in %s on line %d 37NULL 38*** Done *** 39 40