Return to copy_variation12.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file |
1.1 misho 1: --TEST-- 2: Test copy() function: usage variations - dir as source (Bug #42111) 3: --SKIPIF-- 4: <?php 5: if(substr(PHP_OS, 0, 3) == "WIN") 6: die("skip Do not run on Windows"); 7: ?> 8: 9: --FILE-- 10: <?php 11: /* Prototype: bool copy ( string $source, string $dest ); 12: Description: Makes a copy of the file source to dest. 13: Returns TRUE on success or FALSE on failure. 14: */ 15: 16: /* Test copy(): Trying to create a copy of an existing dir */ 17: 18: $file_path = dirname(__FILE__); 19: 20: echo "*** Test copy() function: Trying to create a copy of an existing dir ***\n"; 21: $src_dir = $file_path."/copy_variation12"; 22: mkdir($src_dir); 23: 24: $dest = $file_path."/copy_copy_variation12"; 25: 26: var_dump( copy($src_dir, $dest) ); 27: 28: var_dump( file_exists($dest) ); 29: 30: var_dump( filesize($src_dir) ); 31: var_dump( filesize($dest) ); 32: 33: echo "*** Done ***\n"; 34: ?> 35: 36: --CLEAN-- 37: <?php 38: rmdir(dirname(__FILE__)."/copy_variation12"); 39: ?> 40: 41: --EXPECTF-- 42: *** Test copy() function: Trying to create a copy of an existing dir *** 43: 44: Warning: copy(): The first argument to copy() function cannot be a directory in %scopy_variation12.php on line %d 45: bool(false) 46: bool(false) 47: int(%d) 48: 49: Warning: filesize(): stat failed for %scopy_copy_variation12 in %scopy_variation12.php on line %d 50: bool(false) 51: *** Done ***