From: Raghubansh Kumar Date: Thu, 14 Jun 2007 20:12:58 +0000 (+0000) Subject: New tests for file system handling functions X-Git-Tag: php-5.2.4RC1~349 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=788ac84cf4b7e15a2c014bfacd9a630bfec06d8b;p=php New tests for file system handling functions --- diff --git a/ext/standard/tests/file/rename_basic.phpt b/ext/standard/tests/file/rename_basic.phpt new file mode 100755 index 0000000000..8a255ca6ef --- /dev/null +++ b/ext/standard/tests/file/rename_basic.phpt @@ -0,0 +1,118 @@ +--TEST-- +Test rename() function: basic functionality +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing rename() for basic functions on existing file *** +bool(true) +bool(false) +bool(true) + +*** Testing rename() on non-existing file *** + +Warning: rename(%s/non_existent_file.tmp,%s/rename_basic_new1.tmp): No such file or directory in %s on line %d +bool(false) +bool(false) +bool(false) + +*** Testing rename() on existing directory *** +bool(true) +bool(false) +bool(true) + +*** Testing rename() on non-existing directory *** + +Warning: rename(%s/non_existent_dir,%s/rename_basic_dir2): No such file or directory in %s on line %d +bool(false) +bool(false) +bool(false) + +*** Testing rename() by giving stream context as third argument *** +bool(true) +bool(false) +bool(true) +bool(true) +bool(false) +bool(true) +Done diff --git a/ext/standard/tests/file/rename_error.phpt b/ext/standard/tests/file/rename_error.phpt new file mode 100755 index 0000000000..fae2b4f373 --- /dev/null +++ b/ext/standard/tests/file/rename_error.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test rename() function: error conditions +--FILE-- + +--EXPECTF-- +*** Testing rename() for error conditions *** + +Warning: rename() expects at least 2 parameters, 0 given in %s on line %d +bool(false) + +Warning: rename() expects at least 2 parameters, 1 given in %s on line %d +bool(false) + +Warning: rename() expects at most 3 parameters, 4 given in %s on line %d +bool(false) +Done