]> granicus.if.org Git - php/commitdiff
Silence false positives in test failures
authorSara Golemon <pollita@php.net>
Thu, 6 Apr 2006 19:51:36 +0000 (19:51 +0000)
committerSara Golemon <pollita@php.net>
Thu, 6 Apr 2006 19:51:36 +0000 (19:51 +0000)
ext/standard/tests/file/004.phpt
ext/standard/tests/file/bug27508.phpt
ext/standard/tests/file/bug27619.phpt
ext/standard/tests/file/bug35781.phpt

index f1fab47ac3266e2cda1c825084fde737891d4a4b..ed3f8d7fbed3e6b475d8408db9350ec6c85ebd8c 100644 (file)
@@ -31,7 +31,7 @@ file_put_contents() test
        }
        echo "\n";
        
-       $ret = file_put_contents("TEST4", __FILE__);
+       $ret = file_put_contents("TEST4", (binary)__FILE__);
        echo "Bool Test: ";
        if ($ret !== FALSE && md5(__FILE__) == md5_file("TEST4")) {
                echo 'OK';
index 5374a0dcbcf65d4537a0b237f193488caa41d32e..95a3122184f5c2758186eacc70b8dc95e41bc7e6 100644 (file)
@@ -46,9 +46,9 @@ $tn = tempnam('/tmp', 'foo');
 
 $fp = fopen("myFile://" . urlencode($tn), "w+");
 
-fwrite($fp, "line1\n");
-fwrite($fp, "line2\n");
-fwrite($fp, "line3\n");
+fwrite($fp, b"line1\n");
+fwrite($fp, b"line2\n");
+fwrite($fp, b"line3\n");
 
 debug_zval_dump(feof($fp));
 rewind($fp);
index 095a18c199ff6c028be3f047c25a50e0157d334e..1acb9fc69c038d7b5fb029a9f231b680ff3939f5 100644 (file)
@@ -3,7 +3,7 @@ Bug #27619 (filters not applied to pre-buffered data)
 --FILE--
 <?php
        $fp = tmpfile();
-       fwrite($fp, "this is a lowercase string.\n");
+       fwrite($fp, b"this is a lowercase string.\n");
        rewind($fp);
 
        /* Echo out the first four bytes 'this' without applying filter
index 5dc684a65df4a19d5aa0fd91a601371ca69e26f0..cdc467cdff3a4c3324e78d1bb13fbb6e08313bb8 100644 (file)
@@ -7,7 +7,7 @@ $filename = dirname(__FILE__)."/bug35781.txt";
        
 $fp = fopen($filename, "w");
 stream_filter_append($fp, "string.rot13", -49);
-fwrite($fp, "This is a test\n");
+fwrite($fp, b"This is a test\n");
 rewind($fp);
 fpassthru($fp);
 fclose($fp);