]> granicus.if.org Git - php/commitdiff
fix tests
authorRaghubansh Kumar <kraghuba@php.net>
Fri, 9 Nov 2007 12:02:42 +0000 (12:02 +0000)
committerRaghubansh Kumar <kraghuba@php.net>
Fri, 9 Nov 2007 12:02:42 +0000 (12:02 +0000)
ext/standard/tests/strings/str_replace.phpt
ext/standard/tests/strings/stripos_variation10.phpt
ext/standard/tests/strings/strpos.phpt
ext/standard/tests/strings/strrchr_variation10.phpt
ext/standard/tests/strings/strrchr_variation11.phpt
ext/standard/tests/strings/strrpos_variation10.phpt
ext/standard/tests/strings/strstr.phpt

index ae71aaaf592e86aa2c28cae191b038c8d79c18f2..2408c82f09f9d11a72542787979809f1b5721902 100644 (file)
@@ -27,8 +27,10 @@ var_dump( str_replace("long string here", "", "", $count) );
 var_dump( $count );
 
 $fp = fopen( __FILE__, "r" );
-var_dump( str_replace($fp, $fp, $fp, $fp) );
-var_dump( $fp );
+$fp_copy = $fp; 
+var_dump( str_replace($fp_copy, $fp_copy, $fp_copy, $fp_copy) );
+var_dump( $fp_copy );
+fclose($fp);
 
 echo "\n*** Testing str_replace() with various search values ***";
 $search_arr = array( TRUE, FALSE, 1, 0, -1, "1", "0", "-1",  NULL, 
@@ -230,12 +232,9 @@ var_dump( str_replace(NULL) );
 var_dump( str_replace(1, 2) );
 var_dump( str_replace(1,2,3,$var,5) );
 
-echo "Done\n";
-
---CLEAN--
-fclose($fp);
 fclose($resource1);
 closedir($resource2);
+echo "Done\n";
 
 ?>
 --EXPECTF--    
@@ -248,7 +247,7 @@ string(1) "q"
 int(1)
 string(0) ""
 int(0)
-string(14) "Resource id #5"
+string(%d) "Resource id #%d"
 int(1)
 
 *** Testing str_replace() with various search values ***
@@ -910,9 +909,9 @@ array(2) {
 int(1)
 
 -- Testing Resources --
-string(14) "Resource id #6"
+string(%d) "Resource id #%d"
 int(0)
-string(14) "Resource id #7"
+string(%d) "Resource id #%d"
 int(0)
 
 -- Testing a longer and heredoc string --
index efdbb52389e70d570b5312179faecdf104c89f81..963545cf2fea4ffa4280c5c2d82d83e9f340aaf0 100644 (file)
@@ -41,8 +41,8 @@ $needles =  array (
   // float values
   10.5,
   -10.5,
-  10.5e10,
-  10.6E-10,
+  10.1234567e10,
+  10.7654321E-10,
   .5,
 
   // array values
@@ -182,7 +182,7 @@ bool(false)
 -- Iteration 24 --
 
 Warning: stripos(): needle is not a string or an integer in %s on line %d
-bool(false)
+%s
 
 -- Iteration 25 --
 
index e64468135082651638234b2de27f0848d897d4d5..566ef6c75c6d71ae463c5a07be90200f71a86fef 100644 (file)
Binary files a/ext/standard/tests/strings/strpos.phpt and b/ext/standard/tests/strings/strpos.phpt differ
index 5de3b22ffc6b66b530e1387c84450fe21a7aaabb..c807dd44947ad9a80bb9eb58c437257052b92e36 100644 (file)
@@ -79,8 +79,8 @@ $needles =  array (
   // float values
   10.5,
   -10.5,
-  10.5e10,
-  10.6E-10,
+  10.1234567e10,
+  10.7654321E-10,
   .5,
 
   // array values
@@ -180,7 +180,7 @@ bool(false)
 -- Iteration 23 --
 bool(false)
 -- Iteration 24 --
-bool(false)
+%s
 -- Iteration 25 --
 bool(false)
 -- Iteration 26 --
index d04710d7d7856552609f8de3a74342c327e3b931..a179c4089a7eaccd35b97535f2c083b6b8480e02 100644 (file)
@@ -37,8 +37,8 @@ $values =  array (
   // float values
   10.5,
   -10.5,
-  10.5e10,
-  10.6E-10,
+  10.1234567e10,
+  10.7654321E-10,
   .5,
 
   // array values
@@ -80,8 +80,6 @@ $values =  array (
 $counter = 1;
 for($index = 0; $index < count($values); $index ++) {
   echo "-- Iteration $counter --\n";
-  $haystack = $values[$index];
-
   var_dump( strrchr($values[$index], $values[$index]) );
   $counter ++;
 }
@@ -151,7 +149,7 @@ bool(false)
 -- Iteration 23 --
 bool(false)
 -- Iteration 24 --
-bool(false)
+%s
 -- Iteration 25 --
 bool(false)
 -- Iteration 26 --
index abdc5e2f49088bb5d8b758eef5e3005cbcd3fea3..f3adb3ee92dc63bde4eb66d70064c2bba2c4a6a5 100644 (file)
@@ -41,8 +41,8 @@ $needles =  array (
   // float values
   10.5,
   -10.5,
-  10.5e10,
-  10.6E-10,
+  10.1234567e10,
+  10.7654321E-10,
   .5,
 
   // array values
@@ -142,7 +142,7 @@ bool(false)
 -- Iteration 23 --
 bool(false)
 -- Iteration 24 --
-bool(false)
+%s
 -- Iteration 25 --
 bool(false)
 -- Iteration 26 --
index ab10c9efbe9ca19122b76f8dad2e94d16df50ef1..8c76c65d72b662e99002b643aeb406339c690d9e 100644 (file)
Binary files a/ext/standard/tests/strings/strstr.phpt and b/ext/standard/tests/strings/strstr.phpt differ