1--TEST--
2Test copy() function: usage variations - dir as source
3--SKIPIF--
4<?php
5if(substr(PHP_OS, 0, 3) != "WIN")
6  die("skip Run only 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 = dirname(__FILE__);
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) );
30
31echo "*** Done ***\n";
32?>
33
34--CLEAN--
35<?php
36unlink(dirname(__FILE__)."/copy_copy_variation12");
37rmdir(dirname(__FILE__)."/copy_variation12");
38?>
39
40--EXPECTF--
41*** Test copy() function: Trying to create a copy of an existing dir ***
42
43Warning: copy(): The first argument to copy() function cannot be a directory in %s on line %d
44bool(false)
45bool(false)
46int(0)
47*** Done ***
48