1--TEST--
2Test 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
14echo "*** 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");
17fwrite($file_handle, str_repeat(b"Hello2world...\n", 100));
18fclose($file_handle);
19
20var_dump( copy($file, $file) );
21var_dump( file_exists($file) );
22var_dump( filesize($file) );
23
24echo "*** Done ***\n";
25?>
26
27--CLEAN--
28<?php
29unlink(dirname(__FILE__)."/copy_variation10.tmp");
30?>
31
32--EXPECTF--
33*** Test copy(): Trying to create a copy of file with the same source name ***
34bool(false)
35bool(true)
36int(1500)
37*** Done ***
38