Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / standard / tests / file / copy_basic.phpt
blob32788f9f74c1d88354ab05f07a00b32af9313b0b
1 --TEST--
2 Test copy() function: basic functionality
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  */
10 echo "*** Testing copy() function: to copy file from source to destination --\n"; 
12 var_dump( file_exists(__FILE__) );
14 /* copying the file */
15 $file_path = dirname(__FILE__);
16 $file_name1 = $file_path."/copy_basic1.tmp";
17 $file_name2 = $file_path."/copy_basic2.tmp";
18 var_dump( copy(__FILE__, $file_name1) );
19 var_dump( copy($file_name1, $file_name2) );
21 echo "-- Checking whether the copy of file exists --\n";
22 var_dump( file_exists($file_name1) );
23 var_dump( file_exists($file_name2) );
25 echo "-- Checking filepermissions of file and its copies --\n";
26 printf( "%o", fileperms(__FILE__) );
27 echo "\n";
28 printf( "%o", fileperms($file_name1) );
29 echo "\n";
30 printf( "%o", fileperms($file_name2) );
31 echo "\n";
33 echo "*** Done ***\n";
36 --CLEAN--
37 <?php
38 $file_path = dirname(__FILE__);
39 $file_name1 = $file_path."/copy_basic1.tmp";
40 $file_name2 = $file_path."/copy_basic2.tmp";
41 unlink($file_name1);
42 unlink($file_name2);
45 --EXPECTF--
46 *** Testing copy() function: to copy file from source to destination --
47 bool(true)
48 bool(true)
49 bool(true)
50 -- Checking whether the copy of file exists --
51 bool(true)
52 bool(true)
53 -- Checking filepermissions of file and its copies --
57 *** Done ***