]> granicus.if.org Git - php/commitdiff
- more EOL fixes, don't use expectf
authorPierre Joye <pajoye@php.net>
Thu, 28 Jan 2010 00:37:20 +0000 (00:37 +0000)
committerPierre Joye <pajoye@php.net>
Thu, 28 Jan 2010 00:37:20 +0000 (00:37 +0000)
ext/standard/tests/file/fflush_basic.phpt
ext/standard/tests/file/fgetss_basic1.phpt
ext/standard/tests/file/fgetss_basic2-win32.phpt
ext/standard/tests/file/fgetss_variation1-win32.phpt
ext/standard/tests/file/fgetss_variation3-win32.phpt
ext/standard/tests/file/fgetss_variation4.phpt
ext/standard/tests/file/fgetss_variation5-win32.phpt
ext/standard/tests/file/file.inc

index 7e8cba7188bae23570d944a4b1085cf4ddd00ee6..f375c4f0794a3a345fbe9524c7668b93f0dd95f0 100755 (executable)
@@ -20,6 +20,7 @@ $filename = "$file_path/fflush_basic.tmp";
 $file_handle = fopen($filename, "w");
 if($file_handle == false)
   exit("Error:failed to open file $filename");
+
 if(substr(PHP_OS, 0, 3) == "WIN")  {
        $data = str_replace("\r",'', $data);
 }
index ab9eae0be29c629ad2b83e580ea33611b7e7f0db..4c5881d5881317b6e309d636301506f0cf096973 100644 (file)
@@ -22,7 +22,9 @@ is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg>
 <html> html </html> <?php echo "php"; ?>
 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 --
index 5a87b4c0395e5f6e80f0c94e3fc6b86c7798bd7e..9187fe532a2897123f6730902faa585be2ac4f66 100644 (file)
@@ -29,7 +29,9 @@ $string_with_tags = <<<EOT
 is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg>
 <html> html </html> <?php echo "php"; ?>
 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 */
index dc3ee930c7fe6d0dd6ccf99212ff9a4b2ef1b2c0..0aca5d37609e264f22296178504e79bbca78d1e9 100644 (file)
@@ -36,6 +36,10 @@ this text contains some html tags <body> body </body> <br> br </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 --
index ea8ee2f8c6a08a855baab072074b144de59f02d0..7539b3687635d92b4b0b8a2658f5409f3c5734e0 100644 (file)
@@ -35,6 +35,10 @@ this text contains some html tags <body> body </body> <br> br </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 --
index 134a9652abf706bd3d3506e7430b29acc744e610..6c201d1a9e66c33d0fcb4ccd3a2d6389f9fcbbe9 100644 (file)
@@ -1,5 +1,10 @@
 --TEST--
 Test fgetss() function : usage variations - read  modes, file pointer at EOF
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN")
+  die("skip not for Windows");
+?>
 --FILE--
 <?php
 /*
index d806ddd47df703ab1d5655f2c6171e7ee4fbc65b..cedc7b98da6f33be37d92eb728261235ac96e687 100644 (file)
@@ -33,6 +33,9 @@ this is a line with more than eighty character,want to check line splitting corr
 this text contains some html tags <body> body </body> <br> br </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 --
index efb425ca42239bbd29c017c5c9e3e690e1d817d7..c0f86e7c3fa1d439c0470d5c38387983c93ae3f4 100644 (file)
@@ -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);