1--TEST--
2Test rename() function: error conditions
3--FILE--
4<?php
5/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] );
6   Description: Renames a file or directory
7*/
8
9echo "*** Testing rename() for error conditions ***\n";
10//Zero argument
11var_dump( rename() );
12
13// less than expected,1 argument
14var_dump( rename(__FILE__) );
15
16// more than expected no. of arguments
17$context = stream_context_create();
18$filename = __FILE__;
19$new_filename = __FILE__.".tmp";
20var_dump( rename($filename, $new_filename, $context, "extra_args") );
21
22echo "Done\n";
23?>
24--EXPECTF--
25*** Testing rename() for error conditions ***
26
27Warning: rename() expects at least 2 parameters, 0 given in %s on line %d
28bool(false)
29
30Warning: rename() expects at least 2 parameters, 1 given in %s on line %d
31bool(false)
32
33Warning: rename() expects at most 3 parameters, 4 given in %s on line %d
34bool(false)
35Done
36