Annotation of embedaddon/php/ext/standard/tests/file/copy_variation10.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test copy() function: usage variations - identical names 
                      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: /* Test copy(): Try copying source file to desntination file, where destination file name is identical to source name */
                     11: 
                     12: $file_path = dirname(__FILE__);
                     13: 
                     14: echo "*** Test copy(): Trying to create a copy of file with the same source name ***\n";
                     15: $file = $file_path."/copy_variation10.tmp";
                     16: $file_handle =  fopen($file, "w");
                     17: fwrite($file_handle, str_repeat(b"Hello2world...\n", 100));
                     18: fclose($file_handle);
                     19: 
                     20: var_dump( copy($file, $file) ); 
                     21: var_dump( file_exists($file) );  
                     22: var_dump( filesize($file) );
                     23: 
                     24: echo "*** Done ***\n";
                     25: ?>
                     26: 
                     27: --CLEAN--
                     28: <?php
                     29: unlink(dirname(__FILE__)."/copy_variation10.tmp");
                     30: ?>
                     31: 
                     32: --EXPECTF--
                     33: *** Test copy(): Trying to create a copy of file with the same source name ***
                     34: bool(false)
                     35: bool(true)
                     36: int(1500)
                     37: *** Done ***

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>