From 3d4ab24d98bc9c294140beb1f09a99e465b920b9 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Sun, 7 Feb 2010 21:07:10 +0000 Subject: [PATCH] - fix/sync tests --- .../tests/file/005_variation2-win32.phpt | 10 +- ext/standard/tests/file/bug47767.phpt | 5 + ext/standard/tests/file/chmod_variation3.phpt | 16 +-- ext/standard/tests/file/fflush_basic.phpt | 4 + ext/standard/tests/file/fgetss_basic1.phpt | 6 +- .../tests/file/fgetss_basic2-win32.phpt | 4 +- .../tests/file/fgetss_variation1-win32.phpt | 6 +- .../tests/file/fgetss_variation3-win32.phpt | 6 +- .../tests/file/fgetss_variation4.phpt | 5 + .../tests/file/fgetss_variation5-win32.phpt | 5 +- ext/standard/tests/file/file.inc | 20 +-- .../tests/file/fopen_variation10-win32.phpt | 5 + .../tests/file/fopen_variation11-win32.phpt | 4 + .../tests/file/fopen_variation17.phpt | 2 +- ext/standard/tests/file/fpassthru_basic.phpt | 4 +- .../tests/file/mkdir_variation1-win32.phpt | 16 +-- .../tests/file/rename_variation-win32.phpt | 2 +- .../tests/file/rename_variation11-win32.phpt | 6 +- .../tests/file/rename_variation12-win32.phpt | 121 +++++++++++++++++ .../tests/file/rename_variation12.phpt | 12 +- .../tests/file/rename_variation13-win32.phpt | Bin 4553 -> 3947 bytes .../tests/file/rename_variation13.phpt | 19 ++- .../tests/file/rename_variation3-win32.phpt | 5 +- .../tests/file/rename_variation6-win32.phpt | 4 + .../tests/file/rename_variation8-win32.phpt | 70 ++++++++++ .../tests/file/rename_variation8.phpt | 5 + .../tests/file/rename_variation9.phpt | 2 +- .../tests/file/rmdir_variation1-win32.phpt | 16 +-- ext/standard/tests/file/rmdir_variation1.phpt | 2 +- .../tests/file/tempnam_variation3-win32.phpt | 123 ++++++++---------- .../tests/file/tempnam_variation3.phpt | 2 +- .../tests/file/tempnam_variation7-win32.phpt | 73 +++++------ .../tests/file/tempnam_variation7.phpt | 2 +- .../tests/file/unlink_error-win32.phpt | 6 +- ext/standard/tests/file/userstreams_003.phpt | 2 +- .../tests/file/windows_acls/common.inc | 2 +- .../tests/file/windows_links/bug48746.phpt | 5 +- .../tests/file/windows_links/bug48746_2.phpt | 8 +- .../tests/file/windows_links/bug48746_3.phpt | 10 +- 39 files changed, 423 insertions(+), 192 deletions(-) create mode 100644 ext/standard/tests/file/rename_variation12-win32.phpt create mode 100644 ext/standard/tests/file/rename_variation8-win32.phpt diff --git a/ext/standard/tests/file/005_variation2-win32.phpt b/ext/standard/tests/file/005_variation2-win32.phpt index 513182ddeb..45dcbc5f07 100644 --- a/ext/standard/tests/file/005_variation2-win32.phpt +++ b/ext/standard/tests/file/005_variation2-win32.phpt @@ -108,18 +108,18 @@ Warning: filectime(): stat failed for | in %s on line %d *** testing touch *** -Warning: touch(): Unable to create file because %s in %s on line %d +Warning: touch(): %s in %s on line %d bool(false) -Warning: touch(): Unable to create file because %s in %s on line %d +Warning: touch(): %s in %s on line %d bool(false) -Warning: touch(): Unable to create file because %s in %s on line %d +Warning: touch(): %s in %s on line %d bool(false) -Warning: touch(): Unable to create file because %s in %s on line %d +Warning: touch(): %s in %s on line %d bool(false) -Warning: touch(): Unable to create file | because %s in %s on line %d +Warning: touch(): %s in %s on line %d bool(false) Done diff --git a/ext/standard/tests/file/bug47767.phpt b/ext/standard/tests/file/bug47767.phpt index 62388c28cb..312476aa55 100644 --- a/ext/standard/tests/file/bug47767.phpt +++ b/ext/standard/tests/file/bug47767.phpt @@ -10,6 +10,11 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) { if(PHP_WINDOWS_VERSION_MAJOR < 6) { die('skip windows version 6.0+ only test'); } + +$ret = exec('mklink rename_variation13tmp.lnk ' . __FILE__ .' 2>&1', $out); +if (strpos($ret, 'privilege')) { + die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); +} ?> --FILE-- ksklnm@@$$&$&^%&^%&^%& html EOT; - +if(substr(PHP_OS, 0, 3) == "WIN") { + $string_with_tags = str_replace("\r",'', $string_with_tags); +} /* try reading the file opened in different modes of reading */ $file_modes = array("r","rb", "rt","r+", "r+b", "r+t"); @@ -62,7 +64,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fgetss() : Basic operations *** -- Testing fgetss() with file opened using r mode -- diff --git a/ext/standard/tests/file/fgetss_basic2-win32.phpt b/ext/standard/tests/file/fgetss_basic2-win32.phpt index 5a87b4c039..9187fe532a 100644 --- a/ext/standard/tests/file/fgetss_basic2-win32.phpt +++ b/ext/standard/tests/file/fgetss_basic2-win32.phpt @@ -29,7 +29,9 @@ $string_with_tags = <<ksklnm@@$$&$&^%&^%&^%& html EOT; - +if(substr(PHP_OS, 0, 3) == "WIN") { + $string_with_tags = str_replace("\r",'', $string_with_tags); +} $filename = dirname(__FILE__)."/fgetss_basic2.tmp"; /* try reading the file opened in different modes of reading */ diff --git a/ext/standard/tests/file/fgetss_variation1-win32.phpt b/ext/standard/tests/file/fgetss_variation1-win32.phpt index dc3ee930c7..0aca5d3760 100644 --- a/ext/standard/tests/file/fgetss_variation1-win32.phpt +++ b/ext/standard/tests/file/fgetss_variation1-win32.phpt @@ -36,6 +36,10 @@ this text contains some html tags body
br
this is the line with \n character. EOT; +if(substr(PHP_OS, 0, 3) == "WIN") { + $string_with_tags = str_replace("\r",'', $string_with_tags); +} + $filename = dirname(__FILE__)."/fgetss_variation1.tmp"; /* try reading the file opened in different modes of reading */ @@ -73,7 +77,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fgetss() : usage variations *** -- Testing fgetss() with file opened using w mode -- diff --git a/ext/standard/tests/file/fgetss_variation3-win32.phpt b/ext/standard/tests/file/fgetss_variation3-win32.phpt index ea8ee2f8c6..7539b36876 100644 --- a/ext/standard/tests/file/fgetss_variation3-win32.phpt +++ b/ext/standard/tests/file/fgetss_variation3-win32.phpt @@ -35,6 +35,10 @@ this text contains some html tags body
br
this is the line with \n character. EOT; +if(substr(PHP_OS, 0, 3) == "WIN") { + $string_with_tags = str_replace("\r",'', $string_with_tags); +} + $filename = dirname(__FILE__)."/fgetss_variation3.tmp"; /* try reading the file opened in different modes of reading */ @@ -76,7 +80,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fgetss() : usage variations *** -- Testing fgetss() with file opened using w+ mode -- diff --git a/ext/standard/tests/file/fgetss_variation4.phpt b/ext/standard/tests/file/fgetss_variation4.phpt index 134a9652ab..6c201d1a9e 100644 --- a/ext/standard/tests/file/fgetss_variation4.phpt +++ b/ext/standard/tests/file/fgetss_variation4.phpt @@ -1,5 +1,10 @@ --TEST-- Test fgetss() function : usage variations - read modes, file pointer at EOF +--SKIPIF-- + --FILE-- body
br
this is the line with \n character. EOT; +if(substr(PHP_OS, 0, 3) == "WIN") { + $string_with_tags = str_replace("\r",'', $string_with_tags); +} $filename = dirname(__FILE__)."/fgetss_variation5.tmp"; @@ -77,7 +80,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fgetss() : usage variations *** -- Testing fgetss() with file opened using w+ mode -- diff --git a/ext/standard/tests/file/file.inc b/ext/standard/tests/file/file.inc index efb425ca42..c0f86e7c3f 100644 --- a/ext/standard/tests/file/file.inc +++ b/ext/standard/tests/file/file.inc @@ -347,16 +347,16 @@ function create_files( $file_path, filled => total files filled, always returned as 1 perms_changed => total files permission changed */ -function create_links( $file_path, - $filename, - $link_count = 1, - $link_type = "soft", - $link_size = 1024, - $link_name_prefix = "link", - $link_name_suffix = 1, - $link_file_content = "text", - $link_perms = 0755, - $link_file_extension = ".tmp" +function create_links($file_path, + $filename, + $link_count = 1, + $link_type = "soft", + $link_size = 1024, + $link_name_prefix = "link", + $link_name_suffix = 1, + $link_file_content = "text", + $link_perms = 0755, + $link_file_extension = ".tmp" ) { $return_value = array('created' => 0, 'filled' => 0, 'perms_changed' => 0); diff --git a/ext/standard/tests/file/fopen_variation10-win32.phpt b/ext/standard/tests/file/fopen_variation10-win32.phpt index bf8d3889fa..c949f86fa2 100644 --- a/ext/standard/tests/file/fopen_variation10-win32.phpt +++ b/ext/standard/tests/file/fopen_variation10-win32.phpt @@ -6,6 +6,11 @@ Dave Kelsey --FILE-- --FILE-- $value) { *** Testing mkdir() : usage variation *** --uppercase NULL-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --lowercase null-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --lowercase false-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --uppercase FALSE-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --empty string DQ-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --empty string SQ-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --undefined var-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --unset var-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --single space-- Error: 2 - mkdir(): %s, %s(%d) diff --git a/ext/standard/tests/file/rename_variation-win32.phpt b/ext/standard/tests/file/rename_variation-win32.phpt index cebf0334c5..a10c6dfbe7 100644 --- a/ext/standard/tests/file/rename_variation-win32.phpt +++ b/ext/standard/tests/file/rename_variation-win32.phpt @@ -69,7 +69,7 @@ bool(false) bool(true) -- Iteration 2 -- -Warning: rename(%s/rename_variation/rename_variation.tmp/,%s/rename_variation2.tmp): No such file or directory in %s on line %d +Warning: rename(%s/rename_variation/rename_variation.tmp/,%s/rename_variation2.tmp): The filename, directory name, or volume label syntax is incorrect. (code: 123) in %s on line %d bool(false) bool(false) bool(false) diff --git a/ext/standard/tests/file/rename_variation11-win32.phpt b/ext/standard/tests/file/rename_variation11-win32.phpt index d17b0d283c..c13a09a951 100644 --- a/ext/standard/tests/file/rename_variation11-win32.phpt +++ b/ext/standard/tests/file/rename_variation11-win32.phpt @@ -92,12 +92,12 @@ bool(true) -- Iteration 5 -- -Warning: rename(%s\renameVar11\renameVar11Sub\..\\\renameVar11Sub\\..\\..\renameVar11Sub\renameMe.tmp,%s\renameVar11\renameVar11Sub\..\\\renameVar11Sub\\..\\..\renameVar11Sub\IwasRenamed.tmp): No such file or directory in %s on line %d +Warning: rename(%s\renameVar11\renameVar11Sub\..\\\renameVar11Sub\\..\\..\renameVar11Sub\renameMe.tmp,%s\renameVar11\renameVar11Sub\..\\\renameVar11Sub\\..\\..\renameVar11Sub\IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d bool(false) -- Iteration 6 -- -Warning: rename(%s\renameVar11\renameVar11Sub\BADDIR\renameMe.tmp,%s\renameVar11\renameVar11Sub\BADDIR\IwasRenamed.tmp): No such file or directory in %s on line %d +Warning: rename(%s\renameVar11\renameVar11Sub\BADDIR\renameMe.tmp,%s\renameVar11\renameVar11Sub\BADDIR\IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d bool(false) -- Iteration 7 -- @@ -118,7 +118,7 @@ bool(true) -- Iteration 11 -- -Warning: rename(BADDIR\renameMe.tmp,BADDIR\IwasRenamed.tmp): No such file or directory in %s on line %d +Warning: rename(BADDIR\renameMe.tmp,BADDIR\IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d bool(false) -- Iteration 12 -- diff --git a/ext/standard/tests/file/rename_variation12-win32.phpt b/ext/standard/tests/file/rename_variation12-win32.phpt new file mode 100644 index 0000000000..de5fc14004 --- /dev/null +++ b/ext/standard/tests/file/rename_variation12-win32.phpt @@ -0,0 +1,121 @@ +--TEST-- +Test rename() function : variation - various relative, absolute paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing rename() with absolute and relative paths *** + +-- Iteration 1 -- +bool(true) +bool(true) + +-- Iteration 2 -- +bool(true) +bool(true) + +-- Iteration 3 -- +bool(true) +bool(true) + +-- Iteration 4 -- +bool(true) +bool(true) + +-- Iteration 5 -- + +Warning: rename(%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/renameMe.tmp,%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: rename(%s/renameVar11/renameVar11Sub/BADDIR/renameMe.tmp,%s/renameVar11/renameVar11Sub/BADDIR/IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d +bool(false) + +-- Iteration 7 -- +bool(true) +bool(true) + +-- Iteration 8 -- +bool(true) +bool(true) + +-- Iteration 9 -- +bool(true) +bool(true) + +-- Iteration 10 -- +bool(true) +bool(true) + +-- Iteration 11 -- + +Warning: rename(BADDIR/renameMe.tmp,BADDIR/IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d +bool(false) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/rename_variation12.phpt b/ext/standard/tests/file/rename_variation12.phpt index 11274f03d2..168beeffc9 100644 --- a/ext/standard/tests/file/rename_variation12.phpt +++ b/ext/standard/tests/file/rename_variation12.phpt @@ -2,6 +2,10 @@ Test rename() function : variation - various relative, absolute paths --CREDITS-- Dave Kelsey +--SKIPIF-- + --FILE-- ^~82&)(qlWOtggB)^`CvfUQn8_F-ij#G?To9r< W5T@eh3hpV42w|vp#mypoTbTiiydq2h delta 86 zcmaDYcT#zSDeGi2R --SKIPIF-- --FILE-- &1', $out); +if (strpos($ret, 'privilege')) { + die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); +} ?> --FILE-- +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing rename() on non-existing file *** + +Warning: rename(%s/non_existent_file.tmp,%s/rename_variation8_new.tmp): The system cannot find the file specified. (code: 2) 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): The system cannot find the file specified. (code: 2) in %s on line %d +bool(false) +bool(false) +bool(false) +Done + diff --git a/ext/standard/tests/file/rename_variation8.phpt b/ext/standard/tests/file/rename_variation8.phpt index 6b3644aee4..6e236c376c 100644 --- a/ext/standard/tests/file/rename_variation8.phpt +++ b/ext/standard/tests/file/rename_variation8.phpt @@ -1,5 +1,9 @@ --TEST-- Test rename() function: variation +--SKIPIF-- + --FILE-- --CLEAN-- --EXPECTF-- diff --git a/ext/standard/tests/file/rename_variation9.phpt b/ext/standard/tests/file/rename_variation9.phpt index d923e4a3d4..272fa94025 100644 --- a/ext/standard/tests/file/rename_variation9.phpt +++ b/ext/standard/tests/file/rename_variation9.phpt @@ -41,7 +41,7 @@ echo "Done\n"; unlink(dirname(__FILE__)."/rename_variation9_new.tmp"); rmdir(dirname(__FILE__)."/rename_variation_dir9_new"); ?> ---EXPECTF-- +--EXPECT-- *** Testing rename() by giving stream context as third argument *** bool(true) bool(false) diff --git a/ext/standard/tests/file/rmdir_variation1-win32.phpt b/ext/standard/tests/file/rmdir_variation1-win32.phpt index 0732821c54..2516e6162e 100644 --- a/ext/standard/tests/file/rmdir_variation1-win32.phpt +++ b/ext/standard/tests/file/rmdir_variation1-win32.phpt @@ -90,35 +90,35 @@ foreach($inputs as $key =>$value) { *** Testing rmdir() : usage variation *** --uppercase NULL-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --lowercase null-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --lowercase false-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --uppercase FALSE-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --empty string DQ-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --empty string SQ-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --undefined var-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --unset var-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --single space-- diff --git a/ext/standard/tests/file/rmdir_variation1.phpt b/ext/standard/tests/file/rmdir_variation1.phpt index a7a4990072..04fee0ee2a 100644 --- a/ext/standard/tests/file/rmdir_variation1.phpt +++ b/ext/standard/tests/file/rmdir_variation1.phpt @@ -81,7 +81,7 @@ $inputs = array( foreach($inputs as $key =>$value) { echo "\n--$key--\n"; - var_dump( rmdir($value) ); + var_dump(rmdir($value)); }; ?> diff --git a/ext/standard/tests/file/tempnam_variation3-win32.phpt b/ext/standard/tests/file/tempnam_variation3-win32.phpt index 080bce0fb8..fb457cb6ab 100644 --- a/ext/standard/tests/file/tempnam_variation3-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation3-win32.phpt @@ -3,7 +3,7 @@ Test tempnam() function: usage variations - obscure prefixes --SKIPIF-- --FILE-- "; - printf("%o", fileperms($file_name) ); - echo "\n"; - - echo "File created in => "; - $file_dir = dirname($file_name); - if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; - } - else if (realpath($file_dir) == realpath($file_path) || realpath($file_dir."\\") == realpath($file_path)) { - echo "directory specified\n"; - } - else { - echo "unknown location\n"; - } - } - else { - echo "-- File is not created --\n"; - } - - unlink($file_name); + } + } else { + echo "OK\n"; + } + @unlink($file_name); } rmdir($file_path); -echo "\n*** Done ***\n"; +echo "\n*** Done. ***\n"; ?> --EXPECTF-- *** Testing tempnam() with obscure prefixes *** -- Iteration 0 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 1 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 2 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 3 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 4 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 5 -- Failed, not created in the correct directory %s vs %s 0 -- Iteration 6 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 7 -- -Warning: tempnam() expects parameter 2 to be string, array given in %s on line %d --- File is not created -- - -Warning: unlink(): No such file or directory in %s on line %d +Warning: tempnam() expects parameter 2 to be string, array given in %s\ext\standard\tests\file\tempnam_variation3-win32.php on line %d +OK -- Iteration 8 -- -File name is => %s\di%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 9 -- -File name is => %s\ph%s -File permissions are => 100666 -File created in => directory specified - -*** Done *** +OK +*** Done. *** diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt index a0b9511b63..69ab16c896 100644 --- a/ext/standard/tests/file/tempnam_variation3.phpt +++ b/ext/standard/tests/file/tempnam_variation3.phpt @@ -108,7 +108,7 @@ File created in => directory specified Warning: tempnam() expects parameter 2 to be string, array given in %s on line %d -- File is not created -- -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d -- Iteration 8 -- File name is => %s/dir%s File permissions are => 100600 diff --git a/ext/standard/tests/file/tempnam_variation7-win32.phpt b/ext/standard/tests/file/tempnam_variation7-win32.phpt index 5096934e03..34e352a497 100644 --- a/ext/standard/tests/file/tempnam_variation7-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation7-win32.phpt @@ -17,50 +17,47 @@ if(substr(PHP_OS, 0, 3) != "WIN") echo "*** Testing tempnam() with invalid/non-existing directory names ***\n"; /* An array of names, which will be passed as a dir name */ $names_arr = array( - /* Invalid args */ - -1, - TRUE, - FALSE, - NULL, - "", - " ", - "\0", - array(), - - /* Non-existing dirs */ - "/no/such/file/dir", - "php" + /* Invalid args */ + -1, + TRUE, + FALSE, + NULL, + "", + " ", + "\0", + array(), + /* Non-existing dirs */ + "/no/such/file/dir", + "php" ); for( $i=0; $i "; + print($file_name); + echo "\n"; - if( file_exists($file_name) ){ + echo "File permissions are => "; + printf("%o", fileperms($file_name) ); + echo "\n"; - echo "File name is => "; - print($file_name); - echo "\n"; + echo "File created in => "; + $file_dir = dirname($file_name); + if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { + echo "temp dir\n"; + } else { + echo "unknown location\n"; + } + } else { + echo "-- File is not created --\n"; + } - echo "File permissions are => "; - printf("%o", fileperms($file_name) ); - echo "\n"; - - echo "File created in => "; - $file_dir = dirname($file_name); - if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; - } - else { - echo "unknown location\n"; - } - } - else { - echo "-- File is not created --\n"; - } - - unlink($file_name); + unlink($file_name); } echo "\n*** Done ***\n"; @@ -100,7 +97,7 @@ File created in => temp dir Warning: tempnam() expects parameter 1 to be string, array given in %s on line %d -- File is not created -- -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d -- Iteration 8 -- File name is => %s%et%s File permissions are => 100666 diff --git a/ext/standard/tests/file/tempnam_variation7.phpt b/ext/standard/tests/file/tempnam_variation7.phpt index 0e314dabe3..18d074d28d 100644 --- a/ext/standard/tests/file/tempnam_variation7.phpt +++ b/ext/standard/tests/file/tempnam_variation7.phpt @@ -102,7 +102,7 @@ File created in => temp dir Warning: tempnam() expects parameter 1 to be string, array given in %s on line %d -- File is not created -- -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d -- Iteration 8 -- File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 diff --git a/ext/standard/tests/file/unlink_error-win32.phpt b/ext/standard/tests/file/unlink_error-win32.phpt index 2c913aeb57..e55f6ed5cd 100644 --- a/ext/standard/tests/file/unlink_error-win32.phpt +++ b/ext/standard/tests/file/unlink_error-win32.phpt @@ -77,15 +77,15 @@ bool(true) -- Testing unlink() on invalid arguments -- -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d bool(false) bool(false) diff --git a/ext/standard/tests/file/userstreams_003.phpt b/ext/standard/tests/file/userstreams_003.phpt index b30636d205..01a8efbf5c 100644 --- a/ext/standard/tests/file/userstreams_003.phpt +++ b/ext/standard/tests/file/userstreams_003.phpt @@ -101,7 +101,7 @@ bool(false) value: int(0) ptrparam: -int(8192) +int(%d) $option === 3 === 3: bool(true) $value === 0 === 0: diff --git a/ext/standard/tests/file/windows_acls/common.inc b/ext/standard/tests/file/windows_acls/common.inc index 2a1adeb0a4..c4276014af 100644 --- a/ext/standard/tests/file/windows_acls/common.inc +++ b/ext/standard/tests/file/windows_acls/common.inc @@ -118,7 +118,7 @@ function create_dir($name, $perms) { function create_file($name, $perms) { if (empty($name)) { - echo "create_dir: Empty name is not allowed\n"; + echo "create_file: Empty name is not allowed\n"; return; } diff --git a/ext/standard/tests/file/windows_links/bug48746.phpt b/ext/standard/tests/file/windows_links/bug48746.phpt index fd365113dc..6c88c6319c 100644 --- a/ext/standard/tests/file/windows_links/bug48746.phpt +++ b/ext/standard/tests/file/windows_links/bug48746.phpt @@ -19,7 +19,7 @@ if (count($output) == 0) { &1', $out); +if (strpos($ret, 'privilege')) { + die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); } +unlink('mklink bug48746_tmp.lnk'); ?> --FILE-- &1', $out); +if (strpos($out[0], 'recognized')) { + die('skip. junction.exe not found in PATH.'); } + ?> --FILE--