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