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--EXPECTF-- 24*** Testing copy() function: error conditions -- 25 26Warning: copy(/no/file): failed to open stream: No such file or directory in %s on line %d 27bool(false) 28 29Warning: copy() expects at least 2 parameters, 0 given in %s on line %d 30NULL 31 32Warning: copy() expects at least 2 parameters, 1 given in %s on line %d 33NULL 34 35Warning: copy() expects parameter 3 to be resource, string given in %s on line %d 36NULL 37*** Done *** 38