summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2009-08-13 06:44:50 +0000
committerStanislav Malyshev <stas@php.net>2009-08-13 06:44:50 +0000
commite52517d61062a567b0ec87081e181031d714abd6 (patch)
tree1a3541cd13681b1d930655ee11e61cb12d369adf /ext/standard/tests/strings
parentde65a02f1cae8ab959923d394c9e18983ec3c79b (diff)
downloadphp-git-e52517d61062a567b0ec87081e181031d714abd6.tar.gz
standardise and clean up string functions parameter parsing
Diffstat (limited to 'ext/standard/tests/strings')
-rw-r--r--ext/standard/tests/strings/chunk_split_variation2.phpt44
-rw-r--r--ext/standard/tests/strings/chunk_split_variation3.phpt24
-rw-r--r--ext/standard/tests/strings/explode_variation1.phpt28
-rw-r--r--ext/standard/tests/strings/explode_variation2.phpt32
-rw-r--r--ext/standard/tests/strings/stripos_variation1.phpt12
-rw-r--r--ext/standard/tests/strings/stripos_variation10.phpt10
-rw-r--r--ext/standard/tests/strings/stripos_variation11.phpt4
-rw-r--r--ext/standard/tests/strings/stripos_variation2.phpt8
-rw-r--r--ext/standard/tests/strings/stristr.phpt10
-rw-r--r--ext/standard/tests/strings/stristr_variation1.phpt16
-rw-r--r--ext/standard/tests/strings/stristr_variation2.phpt10
-rw-r--r--ext/standard/tests/strings/strpos.phptbin9992 -> 9990 bytes
-rw-r--r--ext/standard/tests/strings/strrchr_variation10.phpt14
-rw-r--r--ext/standard/tests/strings/strrpos_variation10.phpt14
-rw-r--r--ext/standard/tests/strings/strstr.phptbin10343 -> 10539 bytes
15 files changed, 112 insertions, 114 deletions
diff --git a/ext/standard/tests/strings/chunk_split_variation2.phpt b/ext/standard/tests/strings/chunk_split_variation2.phpt
index 7a6c9f6923..d49ec3b1bd 100644
--- a/ext/standard/tests/strings/chunk_split_variation2.phpt
+++ b/ext/standard/tests/strings/chunk_split_variation2.phpt
@@ -110,16 +110,24 @@ Warning: chunk_split(): Chunk length should be greater than zero in %schunk_spli
bool(false)
-- Iteration 6 --
-Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
-bool(false)
+Warning: chunk_split() expects parameter 2 to be long, array given in %schunk_split_variation2.php on line %d
+NULL
-- Iteration 7 --
-string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
+
+Warning: chunk_split() expects parameter 2 to be long, array given in %schunk_split_variation2.php on line %d
+NULL
-- Iteration 8 --
-string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
+
+Warning: chunk_split() expects parameter 2 to be long, array given in %schunk_split_variation2.php on line %d
+NULL
-- Iteration 9 --
-string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
+
+Warning: chunk_split() expects parameter 2 to be long, array given in %schunk_split_variation2.php on line %d
+NULL
-- Iteration 10 --
-string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
+
+Warning: chunk_split() expects parameter 2 to be long, array given in %schunk_split_variation2.php on line %d
+NULL
-- Iteration 11 --
Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
@@ -142,24 +150,24 @@ Warning: chunk_split(): Chunk length should be greater than zero in %schunk_spli
bool(false)
-- Iteration 17 --
-Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
-bool(false)
+Warning: chunk_split() expects parameter 2 to be long, string given in %schunk_split_variation2.php on line %d
+NULL
-- Iteration 18 --
-Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
-bool(false)
+Warning: chunk_split() expects parameter 2 to be long, string given in %schunk_split_variation2.php on line %d
+NULL
-- Iteration 19 --
-Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
-bool(false)
+Warning: chunk_split() expects parameter 2 to be long, string given in %schunk_split_variation2.php on line %d
+NULL
-- Iteration 20 --
-Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
-bool(false)
+Warning: chunk_split() expects parameter 2 to be long, string given in %schunk_split_variation2.php on line %d
+NULL
-- Iteration 21 --
-Notice: Object of class MyClass could not be converted to int in %schunk_split_variation2.php on line %d
-string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
+Warning: chunk_split() expects parameter 2 to be long, object given in %schunk_split_variation2.php on line %d
+NULL
-- Iteration 22 --
Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
@@ -169,5 +177,7 @@ bool(false)
Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
bool(false)
-- Iteration 24 --
-string(%d) "%s"
+
+Warning: chunk_split() expects parameter 2 to be long, resource given in %schunk_split_variation2.php on line %d
+NULL
===DONE===
diff --git a/ext/standard/tests/strings/chunk_split_variation3.phpt b/ext/standard/tests/strings/chunk_split_variation3.phpt
index f314990c79..758bec088b 100644
--- a/ext/standard/tests/strings/chunk_split_variation3.phpt
+++ b/ext/standard/tests/strings/chunk_split_variation3.phpt
@@ -113,24 +113,24 @@ string(100) "This1.07654321E-9 is 1.07654321E-9simp1.07654321E-9le s1.07654321E-
string(40) "This0.5 is 0.5simp0.5le s0.5trin0.5g.0.5"
-- Iteration 10 --
-Notice: Array to string conversion in %s on line %d
-string(52) "ThisArray is ArraysimpArrayle sArraytrinArrayg.Array"
+Warning: chunk_split() expects parameter 3 to be string, array given in %s on line %d
+NULL
-- Iteration 11 --
-Notice: Array to string conversion in %s on line %d
-string(52) "ThisArray is ArraysimpArrayle sArraytrinArrayg.Array"
+Warning: chunk_split() expects parameter 3 to be string, array given in %s on line %d
+NULL
-- Iteration 12 --
-Notice: Array to string conversion in %s on line %d
-string(52) "ThisArray is ArraysimpArrayle sArraytrinArrayg.Array"
+Warning: chunk_split() expects parameter 3 to be string, array given in %s on line %d
+NULL
-- Iteration 13 --
-Notice: Array to string conversion in %s on line %d
-string(52) "ThisArray is ArraysimpArrayle sArraytrinArrayg.Array"
+Warning: chunk_split() expects parameter 3 to be string, array given in %s on line %d
+NULL
-- Iteration 14 --
-Notice: Array to string conversion in %s on line %d
-string(52) "ThisArray is ArraysimpArrayle sArraytrinArrayg.Array"
+Warning: chunk_split() expects parameter 3 to be string, array given in %s on line %d
+NULL
-- Iteration 15 --
string(22) "This is simple string."
-- Iteration 16 --
@@ -154,5 +154,7 @@ string(22) "This is simple string."
-- Iteration 25 --
string(22) "This is simple string."
-- Iteration 26 --
-string(%d) "ThisResource id #%d is Resource id #%dsimpResource id #%dle sResource id #%dtrinResource id #%dg.Resource id #%d"
+
+Warning: chunk_split() expects parameter 3 to be string, resource given in %s on line %d
+NULL
Done \ No newline at end of file
diff --git a/ext/standard/tests/strings/explode_variation1.phpt b/ext/standard/tests/strings/explode_variation1.phpt
index abb3c32236..9c9ce11695 100644
--- a/ext/standard/tests/strings/explode_variation1.phpt
+++ b/ext/standard/tests/strings/explode_variation1.phpt
@@ -133,25 +133,16 @@ array(1) {
}
-- Iteration 10 --
-Notice: Array to string conversion in %s on line %d
-array(1) {
- [0]=>
- string(41) "piece1 piece2 piece3 piece4 piece5 piece6"
-}
+Warning: explode() expects parameter 1 to be string, array given in %s on line %d
+NULL
-- Iteration 11 --
-Notice: Array to string conversion in %s on line %d
-array(1) {
- [0]=>
- string(41) "piece1 piece2 piece3 piece4 piece5 piece6"
-}
+Warning: explode() expects parameter 1 to be string, array given in %s on line %d
+NULL
-- Iteration 12 --
-Notice: Array to string conversion in %s on line %d
-array(1) {
- [0]=>
- string(41) "piece1 piece2 piece3 piece4 piece5 piece6"
-}
+Warning: explode() expects parameter 1 to be string, array given in %s on line %d
+NULL
-- Iteration 13 --
array(2) {
[0]=>
@@ -188,10 +179,9 @@ array(1) {
string(41) "piece1 piece2 piece3 piece4 piece5 piece6"
}
-- Iteration 20 --
-array(1) {
- [0]=>
- string(%d) "%s"
-}
+
+Warning: explode() expects parameter 1 to be string, resource given in %s on line %d
+NULL
-- Iteration 21 --
Warning: explode(): Empty delimiter in %s on line %d
diff --git a/ext/standard/tests/strings/explode_variation2.phpt b/ext/standard/tests/strings/explode_variation2.phpt
index f2c0057fe7..9e1f72c5ac 100644
--- a/ext/standard/tests/strings/explode_variation2.phpt
+++ b/ext/standard/tests/strings/explode_variation2.phpt
@@ -131,25 +131,16 @@ array(1) {
}
-- Iteration 10 --
-Notice: Array to string conversion in %s on line %d
-array(1) {
- [0]=>
- string(5) "Array"
-}
+Warning: explode() expects parameter 2 to be string, array given in %s on line %d
+NULL
-- Iteration 11 --
-Notice: Array to string conversion in %s on line %d
-array(1) {
- [0]=>
- string(5) "Array"
-}
+Warning: explode() expects parameter 2 to be string, array given in %s on line %d
+NULL
-- Iteration 12 --
-Notice: Array to string conversion in %s on line %d
-array(1) {
- [0]=>
- string(5) "Array"
-}
+Warning: explode() expects parameter 2 to be string, array given in %s on line %d
+NULL
-- Iteration 13 --
array(1) {
[0]=>
@@ -188,14 +179,9 @@ array(2) {
string(6) "object"
}
-- Iteration 20 --
-array(3) {
- [0]=>
- string(8) "Resource"
- [1]=>
- string(2) "id"
- [2]=>
- string(%d) "#%d"
-}
+
+Warning: explode() expects parameter 2 to be string, resource given in %s on line %d
+NULL
-- Iteration 21 --
array(1) {
[0]=>
diff --git a/ext/standard/tests/strings/stripos_variation1.phpt b/ext/standard/tests/strings/stripos_variation1.phpt
index f3e743cc02..7aeda4082c 100644
--- a/ext/standard/tests/strings/stripos_variation1.phpt
+++ b/ext/standard/tests/strings/stripos_variation1.phpt
@@ -117,18 +117,10 @@ int(9)
int(8)
bool(false)
-- Iteration 12 --
-
-Warning: stripos(): needle is not a string or an integer in %s on line %d
-bool(false)
-
-Warning: stripos(): needle is not a string or an integer in %s on line %d
+int(8)
bool(false)
-- Iteration 13 --
-
-Warning: stripos(): needle is not a string or an integer in %s on line %d
-bool(false)
-
-Warning: stripos(): needle is not a string or an integer in %s on line %d
+int(8)
bool(false)
-- Iteration 14 --
int(8)
diff --git a/ext/standard/tests/strings/stripos_variation10.phpt b/ext/standard/tests/strings/stripos_variation10.phpt
index 963545cf2f..79ba0ed1dc 100644
--- a/ext/standard/tests/strings/stripos_variation10.phpt
+++ b/ext/standard/tests/strings/stripos_variation10.phpt
@@ -160,7 +160,7 @@ bool(false)
-- Iteration 19 --
-Warning: stripos(): needle is not a string or an integer in %s on line %d
+Notice: Object of class sample could not be converted to int in %s on line %d
bool(false)
-- Iteration 20 --
@@ -170,13 +170,9 @@ bool(false)
bool(false)
-- Iteration 22 --
-
-Warning: stripos(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 23 --
-
-Warning: stripos(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 24 --
@@ -185,12 +181,8 @@ Warning: stripos(): needle is not a string or an integer in %s on line %d
%s
-- Iteration 25 --
-
-Warning: stripos(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 26 --
-
-Warning: stripos(): needle is not a string or an integer in %s on line %d
bool(false)
*** Done ***
diff --git a/ext/standard/tests/strings/stripos_variation11.phpt b/ext/standard/tests/strings/stripos_variation11.phpt
index 4736761261..a754ffa2f4 100644
--- a/ext/standard/tests/strings/stripos_variation11.phpt
+++ b/ext/standard/tests/strings/stripos_variation11.phpt
@@ -170,10 +170,10 @@ Warning: stripos(): Offset not contained in string in %s on line %d
bool(false)
-- Iteration 19 --
-Warning: stripos(): needle is not a string or an integer in %s on line %d
+Notice: Object of class sample could not be converted to int in %s on line %d
bool(false)
-Warning: stripos(): needle is not a string or an integer in %s on line %d
+Notice: Object of class sample could not be converted to int in %s on line %d
bool(false)
-- Iteration 20 --
bool(false)
diff --git a/ext/standard/tests/strings/stripos_variation2.phpt b/ext/standard/tests/strings/stripos_variation2.phpt
index e4d8a153e0..c7f3db4005 100644
--- a/ext/standard/tests/strings/stripos_variation2.phpt
+++ b/ext/standard/tests/strings/stripos_variation2.phpt
@@ -119,18 +119,10 @@ bool(false)
int(10)
int(10)
-- Iteration 12 --
-
-Warning: stripos(): needle is not a string or an integer in %s on line %d
bool(false)
-
-Warning: stripos(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 13 --
-
-Warning: stripos(): needle is not a string or an integer in %s on line %d
bool(false)
-
-Warning: stripos(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 14 --
bool(false)
diff --git a/ext/standard/tests/strings/stristr.phpt b/ext/standard/tests/strings/stristr.phpt
index b11f6ebd9f..8fca54b082 100644
--- a/ext/standard/tests/strings/stristr.phpt
+++ b/ext/standard/tests/strings/stristr.phpt
@@ -22,14 +22,14 @@ stristr() function
Warning: stristr() expects at least 2 parameters, 0 given in %s on line %d
NULL
-Notice: Array to string conversion in %s on line %d
+Warning: stristr() expects parameter 1 to be string, array given in %s on line %d
+NULL
-Warning: stristr(): Empty delimiter in %s on line %d
-bool(false)
+Warning: stristr(): needle is not a string or an integer in %s on line %d
bool(false)
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stristr() expects parameter 1 to be string, array given in %s on line %d
+NULL
string(11) "tEsT sTrInG"
string(6) "sTrInG"
string(6) "sTrInG"
diff --git a/ext/standard/tests/strings/stristr_variation1.phpt b/ext/standard/tests/strings/stristr_variation1.phpt
index b50c937266..fdbd4701cd 100644
--- a/ext/standard/tests/strings/stristr_variation1.phpt
+++ b/ext/standard/tests/strings/stristr_variation1.phpt
@@ -98,16 +98,16 @@ bool(false)
bool(false)
-- Iteration 8 --
-Notice: Array to string conversion in %s on line %d2
-bool(false)
+Warning: stristr() expects parameter 1 to be string, array given in %s on line %d2
+NULL
-- Iteration 9 --
-Notice: Array to string conversion in %s on line %d2
-bool(false)
+Warning: stristr() expects parameter 1 to be string, array given in %s on line %d2
+NULL
-- Iteration 10 --
-Notice: Array to string conversion in %s on line %d2
-bool(false)
+Warning: stristr() expects parameter 1 to be string, array given in %s on line %d2
+NULL
-- Iteration 11 --
bool(false)
-- Iteration 12 --
@@ -123,7 +123,9 @@ bool(false)
-- Iteration 17 --
string(7) " object"
-- Iteration 18 --
-string(%d) " id #%d"
+
+Warning: stristr() expects parameter 1 to be string, resource given in %s on line %d2
+NULL
-- Iteration 19 --
bool(false)
-- Iteration 20 --
diff --git a/ext/standard/tests/strings/stristr_variation2.phpt b/ext/standard/tests/strings/stristr_variation2.phpt
index 7d1d2feb21..335248dc4d 100644
--- a/ext/standard/tests/strings/stristr_variation2.phpt
+++ b/ext/standard/tests/strings/stristr_variation2.phpt
@@ -97,10 +97,16 @@ bool(false)
-- Iteration 7 --
bool(false)
-- Iteration 8 --
+
+Warning: stristr(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 9 --
+
+Warning: stristr(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 10 --
+
+Warning: stristr(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 11 --
bool(false)
@@ -119,7 +125,9 @@ bool(false)
Notice: Object of class sample could not be converted to int in %s on line %d
bool(false)
-- Iteration 18 --
-%s
+
+Warning: stristr(): needle is not a string or an integer in %s on line %d
+bool(false)
-- Iteration 19 --
bool(false)
-- Iteration 20 --
diff --git a/ext/standard/tests/strings/strpos.phpt b/ext/standard/tests/strings/strpos.phpt
index dbc5d6d970..706ddfdcb9 100644
--- a/ext/standard/tests/strings/strpos.phpt
+++ b/ext/standard/tests/strings/strpos.phpt
Binary files differ
diff --git a/ext/standard/tests/strings/strrchr_variation10.phpt b/ext/standard/tests/strings/strrchr_variation10.phpt
index c807dd4494..a96f2b0190 100644
--- a/ext/standard/tests/strings/strrchr_variation10.phpt
+++ b/ext/standard/tests/strings/strrchr_variation10.phpt
@@ -150,14 +150,24 @@ bool(false)
-- Iteration 9 --
bool(false)
-- Iteration 10 --
+
+Warning: strrchr(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 11 --
+
+Warning: strrchr(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 12 --
+
+Warning: strrchr(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 13 --
+
+Warning: strrchr(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 14 --
+
+Warning: strrchr(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 15 --
bool(false)
@@ -180,7 +190,9 @@ bool(false)
-- Iteration 23 --
bool(false)
-- Iteration 24 --
-%s
+
+Warning: strrchr(): needle is not a string or an integer in %s on line %d
+bool(false)
-- Iteration 25 --
bool(false)
-- Iteration 26 --
diff --git a/ext/standard/tests/strings/strrpos_variation10.phpt b/ext/standard/tests/strings/strrpos_variation10.phpt
index f3adb3ee92..86ca6cf927 100644
--- a/ext/standard/tests/strings/strrpos_variation10.phpt
+++ b/ext/standard/tests/strings/strrpos_variation10.phpt
@@ -112,14 +112,24 @@ bool(false)
-- Iteration 9 --
bool(false)
-- Iteration 10 --
+
+Warning: strrpos(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 11 --
+
+Warning: strrpos(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 12 --
+
+Warning: strrpos(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 13 --
+
+Warning: strrpos(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 14 --
+
+Warning: strrpos(): needle is not a string or an integer in %s on line %d
bool(false)
-- Iteration 15 --
bool(false)
@@ -142,7 +152,9 @@ bool(false)
-- Iteration 23 --
bool(false)
-- Iteration 24 --
-%s
+
+Warning: strrpos(): needle is not a string or an integer in %s on line %d
+bool(false)
-- Iteration 25 --
bool(false)
-- Iteration 26 --
diff --git a/ext/standard/tests/strings/strstr.phpt b/ext/standard/tests/strings/strstr.phpt
index fd15b92911..1c8d753e65 100644
--- a/ext/standard/tests/strings/strstr.phpt
+++ b/ext/standard/tests/strings/strstr.phpt
Binary files differ