pajoye          Fri Aug 15 19:26:37 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/standard/tests/file    stream_copy_to_stream.phpt 
  Log:
  - MFH: make it portable without loosing pertinent data
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/stream_copy_to_stream.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u
Index: php-src/ext/standard/tests/file/stream_copy_to_stream.phpt
diff -u php-src/ext/standard/tests/file/stream_copy_to_stream.phpt:1.1.2.2 
php-src/ext/standard/tests/file/stream_copy_to_stream.phpt:1.1.2.2.2.1
--- php-src/ext/standard/tests/file/stream_copy_to_stream.phpt:1.1.2.2  Thu Jul 
13 12:00:17 2006
+++ php-src/ext/standard/tests/file/stream_copy_to_stream.phpt  Fri Aug 15 
19:26:37 2008
@@ -2,6 +2,7 @@
 stream_copy_to_stream() tests
 --FILE--
 <?php
+define('WIN', substr(PHP_OS, 0, 3) == 'WIN');
 
 $initial_file = dirname(__FILE__).'/bug38086.txt';
 $new_file = dirname(__FILE__).'/bug38086_1.txt';
@@ -24,8 +25,11 @@
 $dest = fopen($new_file, 'w');
 var_dump(stream_copy_to_stream($src, $dest, -1));
 fclose($src); fclose($dest);
-
-var_dump(file_get_contents($new_file));
+if (WIN) {
+  var_dump(str_replace("\r\n","\n", file_get_contents($new_file)));
+} else {
+  var_dump(file_get_contents($new_file));
+}
 unlink($new_file);
 
 /* --- */
@@ -37,7 +41,11 @@
 var_dump(stream_copy_to_stream($src, $dest));
 fclose($src); fclose($dest);
 
-var_dump(file_get_contents($new_file));
+if (WIN) {
+  var_dump(str_replace("\r\n","\n", file_get_contents($new_file)));
+} else {
+  var_dump(file_get_contents($new_file));
+}
 unlink($new_file);
 
 /* --- */
@@ -48,7 +56,11 @@
 var_dump(stream_copy_to_stream($src, $dest));
 fclose($src); fclose($dest);
 
-var_dump(file_get_contents($new_file));
+if (WIN) {
+  var_dump(str_replace("\r\n","\n", file_get_contents($new_file)));
+} else {
+  var_dump(file_get_contents($new_file));
+}
 unlink($new_file);
 
 /* --- */
@@ -59,7 +71,12 @@
 var_dump(stream_copy_to_stream($src, $dest, 1000000));
 fclose($src); fclose($dest);
 
-var_dump(file_get_contents($new_file));
+if (WIN) {
+  var_dump(str_replace("\r\n","\n", file_get_contents($new_file)));
+} else {
+  var_dump(file_get_contents($new_file));
+}
+
 unlink($new_file);
 
 /* --- */
@@ -70,7 +87,11 @@
 var_dump(stream_copy_to_stream($src, $dest, 10));
 fclose($src); fclose($dest);
 
-var_dump(file_get_contents($new_file));
+if (WIN) {
+  var_dump(str_replace("\r\n","\n", file_get_contents($new_file)));
+} else {
+  var_dump(file_get_contents($new_file));
+}
 unlink($new_file);
 
 /* --- */
@@ -81,7 +102,11 @@
 var_dump(stream_copy_to_stream($src, $dest, -1));
 fclose($src); fclose($dest);
 
-var_dump(file_get_contents($new_file));
+if (WIN) {
+  var_dump(str_replace("\r\n","\n", file_get_contents($new_file)));
+} else {
+  var_dump(file_get_contents($new_file));
+}
 unlink($new_file);
 
 echo "Done\n";
@@ -89,37 +114,37 @@
 --EXPECTF--    
 int(0)
 string(0) ""
-int(134)
+int(%d)
 string(134) "Nabgure qnl
 Jura gur cnvaf bs yvsr jba'g one zl jnl
 V'yy oernx gurfr punvaf
 Gung ubyq zr qbja
 V'yy grne lbh qbja vagb zl cevingr uryy
 "
-int(134)
+int(%d)
 string(134) "Nabgure qnl
 Jura gur cnvaf bs yvsr jba'g one zl jnl
 V'yy oernx gurfr punvaf
 Gung ubyq zr qbja
 V'yy grne lbh qbja vagb zl cevingr uryy
 "
-int(134)
+int(%d)
 string(134) "Another day
 When the pains of life won't bar my way
 I'll break these chains
 That hold me down
 I'll tear you down into my private hell
 "
-int(134)
+int(%d)
 string(134) "Another day
 When the pains of life won't bar my way
 I'll break these chains
 That hold me down
 I'll tear you down into my private hell
 "
-int(10)
+int(%d)
 string(10) "Another da"
-int(134)
+int(%d)
 string(134) "Another day
 When the pains of life won't bar my way
 I'll break these chains



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to