diff --git a/ext/mbstring/tests/mb_convert_encoding_basic.phpt b/ext/mbstring/tests/mb_convert_encoding_basic.phpt new file mode 100644 index 00000000000..d7f194eb203 --- /dev/null +++ b/ext/mbstring/tests/mb_convert_encoding_basic.phpt @@ -0,0 +1,95 @@ +--TEST-- +Test mb_convert_encoding() function : basic functionality +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_convert_encoding() : basic functionality *** + +-- Convert to JIS -- +JIS encoded string in base64: +string(68) "GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg==" +Converted Strings: +string(68) "GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg==" +string(68) "GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg==" +string(68) "GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg==" + +-- Convert to EUC-JP -- +EUC-JP encoded string in base64: +string(52) "xvzL3LjspcalraW5pcikx6S5oaMwMTIzNKO1o7ajt6O4o7mhow==" +Converted Strings: +string(52) "xvzL3LjspcalraW5pcikx6S5oaMwMTIzNKO1o7ajt6O4o7mhow==" +string(52) "xvzL3LjspcalraW5pcikx6S5oaMwMTIzNKO1o7ajt6O4o7mhow==" +string(52) "xvzL3LjspcalraW5pcikx6S5oaMwMTIzNKO1o7ajt6O4o7mhow==" + +-- Convert to SJIS -- +SJIS encoded string in base64: +string(52) "k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg==" +Converted Strings: +string(52) "k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg==" +string(52) "k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg==" +string(52) "k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg==" + +-- Convert to UTF-8 -- +UTF-8 encoded string in base64: +string(72) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" +Converted Strings: +string(72) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" +string(72) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" +string(72) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_encode_mimeheader_basic.phpt b/ext/mbstring/tests/mb_encode_mimeheader_basic.phpt new file mode 100644 index 00000000000..fb0c2816613 --- /dev/null +++ b/ext/mbstring/tests/mb_encode_mimeheader_basic.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test mb_encode_mimeheader() function : basic functionality +--SKIPIF-- + + +--FILE-- + 'This is an English string. 0123456789', + 'Japanese' => base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC'), + 'Greek' => base64_decode('zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868zrXOvc6/LiAwMTIzNDU2Nzg5Lg==')); + +foreach ($inputs as $lang => $input) { + echo "\nLanguage: $lang\n"; + echo "-- Base 64: --\n"; + var_dump(mb_encode_mimeheader($input, 'UTF-8', 'B')); + echo "-- Quoted-Printable --\n"; + var_dump(mb_encode_mimeheader($input, 'UTF-8', 'Q')); +} + +echo "Done"; +?> +--EXPECTF-- +*** Testing mb_encode_mimeheader() : basic *** + +Language: English +-- Base 64: -- +string(37) "This is an English string. 0123456789" +-- Quoted-Printable -- +string(37) "This is an English string. 0123456789" + +Language: Japanese +-- Base 64: -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" +-- Quoted-Printable -- +string(117) "=?UTF-8?Q?=E6=97=A5=E6=9C=AC=E8=AA=9E=E3=83=86=E3=82=AD=E3=82=B9=E3=83=88?= + =?UTF-8?Q?=E3=81=A7=E3=81=99=E3=80=82?=" + +Language: Greek +-- Base 64: -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" +-- Quoted-Printable -- +string(249) "=?UTF-8?Q?=CE=91=CF=85=CF=84=CF=8C=20=CE=B5=CE=AF=CE=BD=CE=B1=CE=B9=20?= + =?UTF-8?Q?=CE=B5=CE=BB=CE=BB=CE=B7=CE=BD=CE=B9=CE=BA=CF=8C=20=CE=BA=CE=B5?= + =?UTF-8?Q?=CE=AF=CE=BC=CE=B5=CE=BD=CE=BF=2E=20=30=31=32=33=34=35=36=37=38?= + =?UTF-8?Q?=39=2E?=" +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_encode_mimeheader_variation1.phpt b/ext/mbstring/tests/mb_encode_mimeheader_variation1.phpt new file mode 100644 index 00000000000..f440e1d447a --- /dev/null +++ b/ext/mbstring/tests/mb_encode_mimeheader_variation1.phpt @@ -0,0 +1,186 @@ +--TEST-- +Test mb_encode_mimeheader() function : usage variations - Pass different data types to $str arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_encode_mimeheader() : usage variations *** + +-- Iteration 1 -- +string(1) "0" + +-- Iteration 2 -- +string(1) "1" + +-- Iteration 3 -- +string(5) "12345" + +-- Iteration 4 -- +string(5) "-2345" + +-- Iteration 5 -- +string(4) "10.5" + +-- Iteration 6 -- +string(5) "-10.5" + +-- Iteration 7 -- +string(12) "123456789000" + +-- Iteration 8 -- +string(13) "1.23456789E-9" + +-- Iteration 9 -- +string(3) "0.5" + +-- Iteration 10 -- +string(0) "" + +-- Iteration 11 -- +string(0) "" + +-- Iteration 12 -- +string(1) "1" + +-- Iteration 13 -- +string(0) "" + +-- Iteration 14 -- +string(1) "1" + +-- Iteration 15 -- +string(0) "" + +-- Iteration 16 -- +string(0) "" + +-- Iteration 17 -- +string(0) "" + +-- Iteration 18 -- +string(6) "string" + +-- Iteration 19 -- +string(6) "string" + +-- Iteration 20 -- +string(11) "hello world" + +-- Iteration 21 -- +string(14) "Class A object" + +-- Iteration 22 -- +string(0) "" + +-- Iteration 23 -- +string(0) "" + +-- Iteration 24 -- + +Warning: mb_encode_mimeheader() expects parameter 1 to be string, resource given in %s on line %d +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_encode_mimeheader_variation2.phpt b/ext/mbstring/tests/mb_encode_mimeheader_variation2.phpt new file mode 100644 index 00000000000..855c3b33b42 --- /dev/null +++ b/ext/mbstring/tests/mb_encode_mimeheader_variation2.phpt @@ -0,0 +1,224 @@ +--TEST-- +Test mb_encode_mimeheader() function : usage variations - Pass different data types to $charset arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_encode_mimeheader() : usage variations *** + +-- Iteration 1 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "0" in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "12345" in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "-2345" in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "10.5" in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "-10.5" in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "123456789000" in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "1.23456789E-9" in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "0.5" in %s on line %d +bool(false) + +-- Iteration 10 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 12 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 14 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 18 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 19 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 20 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 21 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 22 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 23 -- + +Warning: mb_encode_mimeheader(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: mb_encode_mimeheader() expects parameter 2 to be string, resource given in %s on line %d +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_encode_mimeheader_variation3.phpt b/ext/mbstring/tests/mb_encode_mimeheader_variation3.phpt new file mode 100644 index 00000000000..8c6bf08e766 --- /dev/null +++ b/ext/mbstring/tests/mb_encode_mimeheader_variation3.phpt @@ -0,0 +1,186 @@ +--TEST-- +Test mb_encode_mimeheader() function : usage variations - Pass different data types to $transfer_encoding arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_encode_mimeheader() : usage variations *** + +-- Iteration 1 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 2 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 3 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 4 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 5 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 6 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 7 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 8 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 9 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 10 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 11 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 12 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 13 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 14 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 15 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 16 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 17 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 18 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 19 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 20 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 21 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 22 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 23 -- +string(52) "=?UTF-8?B?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=" + +-- Iteration 24 -- + +Warning: mb_encode_mimeheader() 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/mbstring/tests/mb_encode_mimeheader_variation4.phpt b/ext/mbstring/tests/mb_encode_mimeheader_variation4.phpt new file mode 100644 index 00000000000..64e236d7080 --- /dev/null +++ b/ext/mbstring/tests/mb_encode_mimeheader_variation4.phpt @@ -0,0 +1,187 @@ +--TEST-- +Test mb_encode_mimeheader() function : usage variations - Pass different data types to $linefeed arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_encode_mimeheader() : usage variations *** + +-- Iteration 1 -- +string(114) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=0 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 2 -- +string(114) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=1 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 3 -- +string(118) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=12345 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 4 -- +string(118) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=-2345 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 5 -- +string(117) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=10.5 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 6 -- +string(118) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=-10.5 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 7 -- +string(121) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=12345678 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 8 -- +string(121) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=1.234567 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 9 -- +string(116) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=0.5 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 10 -- +string(113) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 11 -- +string(113) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 12 -- +string(114) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=1 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 13 -- +string(113) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 14 -- +string(114) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=1 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 15 -- +string(113) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 16 -- +string(113) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 17 -- +string(113) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 18 -- +string(119) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=string =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 19 -- +string(119) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=string =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 20 -- +string(121) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=hello wo =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 21 -- +string(121) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=Class A =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 22 -- +string(113) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 23 -- +string(113) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 24 -- + +Warning: mb_encode_mimeheader() expects parameter 4 to be string, resource given in %s on line %d +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_encode_mimeheader_variation5.phpt b/ext/mbstring/tests/mb_encode_mimeheader_variation5.phpt new file mode 100644 index 00000000000..593b3c15a5c --- /dev/null +++ b/ext/mbstring/tests/mb_encode_mimeheader_variation5.phpt @@ -0,0 +1,215 @@ +--TEST-- +Test mb_encode_mimeheader() function : usage variations - Pass different data types to $indent arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_encode_mimeheader() : usage variations *** + +-- Iteration 1 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 2 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 3 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 4 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 5 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66?= + =?UTF-8?B?zrXOr868zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 6 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 7 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 8 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 9 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 10 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 11 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 12 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 13 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 14 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 15 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 16 -- + +Warning: mb_encode_mimeheader() expects parameter 5 to be long, string given in %s on line %d +NULL + +-- Iteration 17 -- + +Warning: mb_encode_mimeheader() expects parameter 5 to be long, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: mb_encode_mimeheader() expects parameter 5 to be long, string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: mb_encode_mimeheader() expects parameter 5 to be long, string given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: mb_encode_mimeheader() expects parameter 5 to be long, string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: mb_encode_mimeheader() expects parameter 5 to be long, object given in %s on line %d +NULL + +-- Iteration 22 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 23 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 24 -- + +Warning: mb_encode_mimeheader() expects parameter 5 to be long, resource given in %s on line %d +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_encode_mimeheader_variation6.phpt b/ext/mbstring/tests/mb_encode_mimeheader_variation6.phpt new file mode 100644 index 00000000000..20ba5c17d4c --- /dev/null +++ b/ext/mbstring/tests/mb_encode_mimeheader_variation6.phpt @@ -0,0 +1,53 @@ +--TEST-- +Test mb_encode_mimeheader() function : usage variations - Pass different strings to $linefeed arg +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_encode_mimeheader() : usage variations *** + +-- Iteration 1 -- +string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 2 -- +string(114) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?= + =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" + +-- Iteration 3 -- +string(116) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=--- =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?=" +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_ereg_basic.phpt b/ext/mbstring/tests/mb_ereg_basic.phpt new file mode 100644 index 00000000000..0bdaf74ee31 --- /dev/null +++ b/ext/mbstring/tests/mb_ereg_basic.phpt @@ -0,0 +1,117 @@ +--TEST-- +Test mb_ereg() function : basic functionality +--SKIPIF-- + +--FILE-- + $value) { + echo " [$key]=>\n "; + if (is_string($value)) { + var_dump(base64_encode($value)); + } else { + var_dump($value); + } + } + echo "}\n"; + } else { + echo "NULL\n"; + } +} +?> + +--EXPECTF-- +*** Testing mb_ereg() : basic functionality *** +Regex encoding set to utf-8 + +**-- ASCII String --** +-- Without $regs argument-- +int(1) +int(1) +--With $regs argument -- +int(36) +array(2) { + [0]=> + string(36) "This is an English string. 012345678" + [1]=> + string(17) "This is an Englis" +} +int(17) +array(1) { + [0]=> + string(17) "This is an Englis" +} + +**-- Multibyte String --** +-- Without $regs argument -- +int(1) +bool(false) +-- With $regs argument -- +int(35) +array(3) { + [0]=> + string(48) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzQ=" + [1]=> + string(12) "5pel5pys6Kqe" + [2]=> + string(8) "MTIzNA==" +} +bool(false) +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_ereg_error.phpt b/ext/mbstring/tests/mb_ereg_error.phpt new file mode 100644 index 00000000000..21216257cd7 --- /dev/null +++ b/ext/mbstring/tests/mb_ereg_error.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test mb_ereg() function : error conditions - pass incorrect number of arguments +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_ereg() : error conditions *** + +-- Testing mb_ereg() function with more than expected no. of arguments -- + +Warning: mb_ereg() expects at most 3 parameters, 4 given in %s on line %d +bool(false) + +-- Testing mb_ereg() function with less than expected no. of arguments -- + +Warning: mb_ereg() expects at least 2 parameters, 1 given in %s on line %d +bool(false) +Done diff --git a/ext/mbstring/tests/mb_ereg_variation1.phpt b/ext/mbstring/tests/mb_ereg_variation1.phpt new file mode 100644 index 00000000000..a8aa5d8badf --- /dev/null +++ b/ext/mbstring/tests/mb_ereg_variation1.phpt @@ -0,0 +1,165 @@ +--TEST-- +Test mb_ereg() function : usage variations - pass different data types to $pattern argument +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_ereg() : usage variations *** + +-- Iteration 1 -- +bool(false) +NULL + +-- Iteration 2 -- +bool(false) +NULL + +-- Iteration 3 -- +bool(false) +NULL + +-- Iteration 4 -- +bool(false) +NULL + +-- Iteration 5 -- +bool(false) +NULL + +-- Iteration 6 -- +bool(false) +NULL + +-- Iteration 7 -- +bool(false) +NULL + +-- Iteration 8 -- +bool(false) +NULL + +-- Iteration 9 -- +bool(false) +NULL + +-- Iteration 10 -- +bool(false) +NULL + +-- Iteration 11 -- +bool(false) +NULL + +-- Iteration 12 -- +int(6) +array(1) { + [0]=> + string(6) "string" +} + +-- Iteration 13 -- +int(6) +array(1) { + [0]=> + string(6) "string" +} + +-- Iteration 14 -- +bool(false) +NULL + +-- Iteration 15 -- +bool(false) +NULL + +-- Iteration 16 -- +bool(false) +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_ereg_variation2.phpt b/ext/mbstring/tests/mb_ereg_variation2.phpt new file mode 100644 index 00000000000..d85c8bd5609 --- /dev/null +++ b/ext/mbstring/tests/mb_ereg_variation2.phpt @@ -0,0 +1,216 @@ +--TEST-- +Test mb_ereg() function : usage variations - pass different data types to $string arg +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_ereg() : usage variations *** + +-- Iteration 1 -- +bool(false) +NULL + +-- Iteration 2 -- +bool(false) +NULL + +-- Iteration 3 -- +bool(false) +NULL + +-- Iteration 4 -- +bool(false) +NULL + +-- Iteration 5 -- +bool(false) +NULL + +-- Iteration 6 -- +bool(false) +NULL + +-- Iteration 7 -- +bool(false) +NULL + +-- Iteration 8 -- +bool(false) +NULL + +-- Iteration 9 -- +bool(false) +NULL + +-- Iteration 10 -- +bool(false) +NULL + +-- Iteration 11 -- +bool(false) +NULL + +-- Iteration 12 -- +bool(false) +NULL + +-- Iteration 13 -- +bool(false) +NULL + +-- Iteration 14 -- +bool(false) +NULL + +-- Iteration 15 -- +bool(false) +NULL + +-- Iteration 16 -- +bool(false) +NULL + +-- Iteration 17 -- +bool(false) +NULL + +-- Iteration 18 -- +int(3) +array(1) { + [0]=> + string(3) "str" +} + +-- Iteration 19 -- +int(3) +array(1) { + [0]=> + string(3) "str" +} + +-- Iteration 20 -- +bool(false) +NULL + +-- Iteration 21 -- +bool(false) +NULL + +-- Iteration 22 -- +bool(false) +NULL + +-- Iteration 23 -- +bool(false) +NULL + +-- Iteration 24 -- + +Warning: mb_ereg() expects parameter 2 to be string, resource given in %s on line %d +bool(false) +NULL +Done diff --git a/ext/mbstring/tests/mb_ereg_variation3.phpt b/ext/mbstring/tests/mb_ereg_variation3.phpt new file mode 100644 index 00000000000..0236e441095 --- /dev/null +++ b/ext/mbstring/tests/mb_ereg_variation3.phpt @@ -0,0 +1,163 @@ +--TEST-- +Test mb_ereg() function : usage variations - pass different character classes to see they match correctly +--SKIPIF-- + +--FILE-- + '[[:alnum:]]+', /*1*/ + 'aBcD' => '[[:alpha:]]+', + 'ab/=' => '[[:ascii:]]+', + " \t" => '[[:blank:]]+', + '234' => '[[:digit:]]+', /*5*/ + "$mb" => '[[:graph:]]+', + 'fjds' => '[[:lower:]]+', + "$mb\t" => '[[:print:]]+', + '.!"*@' => '[[:punct:]]+', + "\t" => '[[:space:]]+', /*10*/ + 'IDSJV' => '[[:upper:]]+', + '3b5D' => '[[:xdigit:]]+'); /*12*/ + +$iterator = 1; +foreach($character_classes as $string => $pattern) { + if (is_array(@$regs)) { + $regs = null; + } + // make sure any multibyte output is in base 64 + echo "\n-- Iteration $iterator --\n"; + var_dump(mb_ereg($pattern, $string, $regs)); + if (strpos($string, $mb) === FALSE) { + var_dump($regs); + } else { + base64_encode_var_dump($regs); + } + $iterator++; +} +/** + * replicate a var dump of an array but outputted string values are base64 encoded + * + * @param array $regs + */ +function base64_encode_var_dump($regs) { + if ($regs) { + echo "array(" . count($regs) . ") {\n"; + foreach ($regs as $key => $value) { + echo " [$key]=>\n "; + if (is_string($value)) { + var_dump(base64_encode($value)); + } else { + var_dump($value); + } + } + echo "}\n"; + } else { + echo "NULL\n"; + } +} + +echo "Done"; +?> + +--EXPECTF-- +*** Testing mb_ereg() : variation *** + +-- Iteration 1 -- +int(3) +array(1) { + [0]=> + string(3) "aB1" +} + +-- Iteration 2 -- +int(4) +array(1) { + [0]=> + string(4) "aBcD" +} + +-- Iteration 3 -- +int(4) +array(1) { + [0]=> + string(4) "ab/=" +} + +-- Iteration 4 -- +int(2) +array(1) { + [0]=> + string(2) " " +} + +-- Iteration 5 -- +int(3) +array(1) { + [0]=> + string(3) "234" +} + +-- Iteration 6 -- +int(9) +array(1) { + [0]=> + string(12) "5pel5pys6Kqe" +} + +-- Iteration 7 -- +int(4) +array(1) { + [0]=> + string(4) "fjds" +} + +-- Iteration 8 -- +int(10) +array(1) { + [0]=> + string(16) "5pel5pys6KqeCQ==" +} + +-- Iteration 9 -- +int(5) +array(1) { + [0]=> + string(5) ".!"*@" +} + +-- Iteration 10 -- +int(1) +array(1) { + [0]=> + string(1) " " +} + +-- Iteration 11 -- +int(5) +array(1) { + [0]=> + string(5) "IDSJV" +} + +-- Iteration 12 -- +int(4) +array(1) { + [0]=> + string(4) "3b5D" +} +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_ereg_variation4.phpt b/ext/mbstring/tests/mb_ereg_variation4.phpt new file mode 100644 index 00000000000..7f7d6dfc93f --- /dev/null +++ b/ext/mbstring/tests/mb_ereg_variation4.phpt @@ -0,0 +1,149 @@ +--TEST-- +Test mb_ereg() function : usage variations - pass different character classes as pattern for multibyte string +--SKIPIF-- + +--FILE-- + $value) { + echo " [$key]=>\n "; + if (is_string($value)) { + var_dump(base64_encode($value)); + } else { + var_dump($value); + } + } + echo "}\n"; + } else { + echo "NULL\n"; + } +} +echo "Done"; + +?> +--EXPECTF-- +*** Testing mb_ereg() : usage variations *** + +-- Iteration 1 -- +int(47) +array(1) { + [0]=> + string(64) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZMDEyMzTvvJXvvJbvvJfvvJjvvJk=" +} + +-- Iteration 2 -- +int(27) +array(1) { + [0]=> + string(36) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ" +} + +-- Iteration 3 -- +int(5) +array(1) { + [0]=> + string(8) "MDEyMzQ=" +} + +-- Iteration 4 -- +bool(false) + +-- Iteration 5 -- +bool(false) + +-- Iteration 6 -- +int(20) +array(1) { + [0]=> + string(28) "MDEyMzTvvJXvvJbvvJfvvJjvvJk=" +} + +-- Iteration 7 -- +int(50) +array(1) { + [0]=> + string(68) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" +} + +-- Iteration 8 -- +bool(false) + +-- Iteration 9 -- +int(50) +array(1) { + [0]=> + string(68) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" +} + +-- Iteration 10 -- +int(3) +array(1) { + [0]=> + string(4) "44CC" +} + +-- Iteration 11 -- +bool(false) + +-- Iteration 12 -- +bool(false) + +-- Iteration 13 -- +int(5) +array(1) { + [0]=> + string(8) "MDEyMzQ=" +} +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_ereg_variation5.phpt b/ext/mbstring/tests/mb_ereg_variation5.phpt new file mode 100644 index 00000000000..95bc599191d --- /dev/null +++ b/ext/mbstring/tests/mb_ereg_variation5.phpt @@ -0,0 +1,82 @@ +--TEST-- +Test mb_ereg() function : usage variations - Test anchors in regex +--SKIPIF-- + +--FILE-- + $value) { + echo " [$key]=>\n "; + if (is_string($value)) { + var_dump(base64_encode($value)); + } else { + var_dump($value); + } + } + echo "}\n"; + } else { + echo "NULL\n"; + } +} +?> +--EXPECTF-- +*** Testing mb_ereg() : usage variations *** + +ASCII String without $regs arg: int(1) +ASCII String with $regs arg: +int(38) +array(1) { + [0]=> + string(38) "This is an English string. 0123456789." +} + +Multibyte String without $regs arg: int(1) +Multubyte String with $regs arg: +int(53) +array(1) { + [0]=> + string(72) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" +} +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_ereg_variation6.phpt b/ext/mbstring/tests/mb_ereg_variation6.phpt new file mode 100644 index 00000000000..33d2ee571a6 --- /dev/null +++ b/ext/mbstring/tests/mb_ereg_variation6.phpt @@ -0,0 +1,185 @@ +--TEST-- +Test mb_ereg() function : usage variations - match special characters +--SKIPIF-- + +--FILE-- + $value) { + echo " [$key]=>\n "; + if (is_string($value)) { + var_dump(base64_encode($value)); + } else { + var_dump($value); + } + } + echo "}\n"; + } else { + echo "NULL\n"; + } +} + +echo "Done"; + +?> +--EXPECTF-- +*** Testing mb_ereg() : usage variations *** +Regex encoding set to utf-8 + +--** Pattern is: \w+ **-- +-- ASCII String: -- +int(4) +array(1) { + [0]=> + string(4) "This" +} +-- Multibyte String: -- +int(27) +array(1) { + [0]=> + string(36) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ" +} + +--** Pattern is: \W+ **-- +-- ASCII String: -- +int(1) +array(1) { + [0]=> + string(1) " " +} +-- Multibyte String: -- +int(3) +array(1) { + [0]=> + string(4) "44CC" +} + +--** Pattern is: \s+ **-- +-- ASCII String: -- +int(1) +array(1) { + [0]=> + string(1) " " +} +-- Multibyte String: -- +bool(false) +NULL + +--** Pattern is: \S+ **-- +-- ASCII String: -- +int(4) +array(1) { + [0]=> + string(4) "This" +} +-- Multibyte String: -- +int(53) +array(1) { + [0]=> + string(72) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" +} + +--** Pattern is: \d+ **-- +-- ASCII String: -- +int(10) +array(1) { + [0]=> + string(10) "0123456789" +} +-- Multibyte String: -- +int(20) +array(1) { + [0]=> + string(28) "MDEyMzTvvJXvvJbvvJfvvJjvvJk=" +} + +--** Pattern is: \D+ **-- +-- ASCII String: -- +int(27) +array(1) { + [0]=> + string(27) "This is an English string. " +} +-- Multibyte String: -- +int(30) +array(1) { + [0]=> + string(40) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC" +} + +--** Pattern is: \b **-- +-- ASCII String: -- +int(1) +array(1) { + [0]=> + bool(false) +} +-- Multibyte String: -- +int(1) +array(1) { + [0]=> + bool(false) +} + +--** Pattern is: \B **-- +-- ASCII String: -- +int(1) +array(1) { + [0]=> + bool(false) +} +-- Multibyte String: -- +int(1) +array(1) { + [0]=> + bool(false) +} +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_ereg_variation7.phpt b/ext/mbstring/tests/mb_ereg_variation7.phpt new file mode 100644 index 00000000000..81c95895793 --- /dev/null +++ b/ext/mbstring/tests/mb_ereg_variation7.phpt @@ -0,0 +1,94 @@ +--TEST-- +Test mb_ereg() function : usage variations - different regex features in $pattern +--SKIPIF-- + +--FILE-- + $value) { + echo " [$key]=>\n "; + if (is_string($value)) { + var_dump(base64_encode($value)); + } else { + var_dump($value); + } + } + echo "}\n"; + } else { + echo "NULL\n"; + } +} + +echo "Done"; + +?> +--EXPECTF-- +*** Testing mb_ereg() : usage variations *** +Regex encoding set to utf-8 +int(38) +array(5) { + [0]=> + string(38) "This is an English string. 0123456789." + [1]=> + string(6) "This i" + [2]=> + string(2) " i" + [3]=> + string(5) "56789" + [4]=> + string(2) "89" +} +int(64) +array(5) { + [0]=> + string(88) "zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868zrXOvc6/LiAwMTIzNDU2Nzg5Lg==" + [1]=> + string(16) "zrXOr869zrHOuSA=" + [2]=> + string(4) "zr8=" + [3]=> + string(8) "NTY3ODk=" + [4]=> + string(4) "ODk=" +} +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_internal_encoding_basic.phpt b/ext/mbstring/tests/mb_internal_encoding_basic.phpt new file mode 100644 index 00000000000..a289dcf8de1 --- /dev/null +++ b/ext/mbstring/tests/mb_internal_encoding_basic.phpt @@ -0,0 +1,36 @@ +--TEST-- +Test mb_internal_encoding() function : basic functionality +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_internal_encoding() : basic functionality *** +string(%d) "%s" +bool(true) +string(5) "UTF-8" +Done diff --git a/ext/mbstring/tests/mb_internal_encoding_error1.phpt b/ext/mbstring/tests/mb_internal_encoding_error1.phpt new file mode 100644 index 00000000000..61f133a44af --- /dev/null +++ b/ext/mbstring/tests/mb_internal_encoding_error1.phpt @@ -0,0 +1,36 @@ +--TEST-- +Test mb_internal_encoding() function : error conditions - pass incorrect number of args +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_internal_encoding() : error conditions *** + +-- Testing mb_internal_encoding() function with more than expected no. of arguments -- + +Warning: mb_internal_encoding() expects at most 1 parameter, 2 given in %s on line %d +bool(false) +Done diff --git a/ext/mbstring/tests/mb_internal_encoding_error2.phpt b/ext/mbstring/tests/mb_internal_encoding_error2.phpt new file mode 100644 index 00000000000..d0a1653ebec --- /dev/null +++ b/ext/mbstring/tests/mb_internal_encoding_error2.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test mb_internal_encoding() function : error conditions - pass an unknown encoding +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_internal_encoding() : error conditions *** + +Warning: mb_internal_encoding(): Unknown encoding "unknown-encoding" in %s on line %d +bool(false) +Done diff --git a/ext/mbstring/tests/mb_internal_encoding_variation1.phpt b/ext/mbstring/tests/mb_internal_encoding_variation1.phpt new file mode 100644 index 00000000000..3aa1784b143 --- /dev/null +++ b/ext/mbstring/tests/mb_internal_encoding_variation1.phpt @@ -0,0 +1,217 @@ +--TEST-- +Test mb_internal_encoding() function : usage variations - Pass different data types as $encoding arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- + +*** Testing mb_internal_encoding() : usage variations *** + +-- Iteration 1 -- + +Warning: mb_internal_encoding(): Unknown encoding "0" in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: mb_internal_encoding(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: mb_internal_encoding(): Unknown encoding "12345" in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: mb_internal_encoding(): Unknown encoding "-2345" in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: mb_internal_encoding(): Unknown encoding "10.5" in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: mb_internal_encoding(): Unknown encoding "-10.5" in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: mb_internal_encoding(): Unknown encoding "123456789000" in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: mb_internal_encoding(): Unknown encoding "1.23456789E-9" in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: mb_internal_encoding(): Unknown encoding "0.5" in %s on line %d +bool(false) + +-- Iteration 10 -- + +Warning: mb_internal_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: mb_internal_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 12 -- + +Warning: mb_internal_encoding(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: mb_internal_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 14 -- + +Warning: mb_internal_encoding(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: mb_internal_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: mb_internal_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: mb_internal_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 18 -- +bool(true) + +-- Iteration 19 -- +bool(true) + +-- Iteration 20 -- +bool(true) + +-- Iteration 21 -- +bool(true) + +-- Iteration 22 -- + +Warning: mb_internal_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 23 -- + +Warning: mb_internal_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: mb_internal_encoding() expects parameter 1 to be string, resource given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_internal_encoding_variation2.phpt b/ext/mbstring/tests/mb_internal_encoding_variation2.phpt new file mode 100644 index 00000000000..3abf2517aaa --- /dev/null +++ b/ext/mbstring/tests/mb_internal_encoding_variation2.phpt @@ -0,0 +1,374 @@ +--TEST-- +Test mb_internal_encoding() function : usage variations - Test different encodings +--SKIPIF-- + +--FILE-- + +--EXPECTF-- + +*** Testing mb_internal_encoding() : usage variations *** + +-- Iteration 1 -- +string(%d) "%s" +bool(true) +string(5) "UCS-4" + +-- Iteration 2 -- +string(5) "UCS-4" +bool(true) +string(7) "UCS-4BE" + +-- Iteration 3 -- +string(7) "UCS-4BE" +bool(true) +string(7) "UCS-4LE" + +-- Iteration 4 -- +string(7) "UCS-4LE" +bool(true) +string(5) "UCS-2" + +-- Iteration 5 -- +string(5) "UCS-2" +bool(true) +string(7) "UCS-2BE" + +-- Iteration 6 -- +string(7) "UCS-2BE" +bool(true) +string(7) "UCS-2LE" + +-- Iteration 7 -- +string(7) "UCS-2LE" +bool(true) +string(6) "UTF-32" + +-- Iteration 8 -- +string(6) "UTF-32" +bool(true) +string(8) "UTF-32BE" + +-- Iteration 9 -- +string(8) "UTF-32BE" +bool(true) +string(8) "UTF-32LE" + +-- Iteration 10 -- +string(8) "UTF-32LE" +bool(true) +string(6) "UTF-16" + +-- Iteration 11 -- +string(6) "UTF-16" +bool(true) +string(8) "UTF-16BE" + +-- Iteration 12 -- +string(8) "UTF-16BE" +bool(true) +string(8) "UTF-16LE" + +-- Iteration 13 -- +string(8) "UTF-16LE" +bool(true) +string(5) "UTF-7" + +-- Iteration 14 -- +string(5) "UTF-7" +bool(true) +string(9) "UTF7-IMAP" + +-- Iteration 15 -- +string(9) "UTF7-IMAP" +bool(true) +string(5) "UTF-8" + +-- Iteration 16 -- +string(5) "UTF-8" +bool(true) +string(5) "ASCII" + +-- Iteration 17 -- +string(5) "ASCII" +bool(true) +string(6) "EUC-JP" + +-- Iteration 18 -- +string(6) "EUC-JP" +bool(true) +string(4) "SJIS" + +-- Iteration 19 -- +string(4) "SJIS" +bool(true) +string(9) "eucJP-win" + +-- Iteration 20 -- +string(9) "eucJP-win" +bool(true) +string(8) "SJIS-win" + +-- Iteration 21 -- +string(8) "SJIS-win" +bool(true) +string(11) "ISO-2022-JP" + +-- Iteration 22 -- +string(11) "ISO-2022-JP" +bool(true) +string(3) "JIS" + +-- Iteration 23 -- +string(3) "JIS" +bool(true) +string(10) "ISO-8859-1" + +-- Iteration 24 -- +string(10) "ISO-8859-1" +bool(true) +string(10) "ISO-8859-2" + +-- Iteration 25 -- +string(10) "ISO-8859-2" +bool(true) +string(10) "ISO-8859-3" + +-- Iteration 26 -- +string(10) "ISO-8859-3" +bool(true) +string(10) "ISO-8859-4" + +-- Iteration 27 -- +string(10) "ISO-8859-4" +bool(true) +string(10) "ISO-8859-5" + +-- Iteration 28 -- +string(10) "ISO-8859-5" +bool(true) +string(10) "ISO-8859-6" + +-- Iteration 29 -- +string(10) "ISO-8859-6" +bool(true) +string(10) "ISO-8859-7" + +-- Iteration 30 -- +string(10) "ISO-8859-7" +bool(true) +string(10) "ISO-8859-8" + +-- Iteration 31 -- +string(10) "ISO-8859-8" +bool(true) +string(10) "ISO-8859-9" + +-- Iteration 32 -- +string(10) "ISO-8859-9" +bool(true) +string(11) "ISO-8859-10" + +-- Iteration 33 -- +string(11) "ISO-8859-10" +bool(true) +string(11) "ISO-8859-13" + +-- Iteration 34 -- +string(11) "ISO-8859-13" +bool(true) +string(11) "ISO-8859-14" + +-- Iteration 35 -- +string(11) "ISO-8859-14" +bool(true) +string(11) "ISO-8859-15" + +-- Iteration 36 -- +string(11) "ISO-8859-15" +bool(true) +string(7) "byte2be" + +-- Iteration 37 -- +string(7) "byte2be" +bool(true) +string(7) "byte2le" + +-- Iteration 38 -- +string(7) "byte2le" +bool(true) +string(7) "byte4be" + +-- Iteration 39 -- +string(7) "byte4be" +bool(true) +string(7) "byte4le" + +-- Iteration 40 -- +string(7) "byte4le" +bool(true) +string(6) "BASE64" + +-- Iteration 41 -- +string(6) "BASE64" +bool(true) +string(13) "HTML-ENTITIES" + +-- Iteration 42 -- +string(13) "HTML-ENTITIES" +bool(true) +string(4) "7bit" + +-- Iteration 43 -- +string(4) "7bit" +bool(true) +string(4) "8bit" + +-- Iteration 44 -- +string(4) "8bit" +bool(true) +string(6) "EUC-CN" + +-- Iteration 45 -- +string(6) "EUC-CN" +bool(true) +string(5) "CP936" + +-- Iteration 46 -- +string(5) "CP936" +bool(true) +string(2) "HZ" + +-- Iteration 47 -- +string(2) "HZ" +bool(true) +string(6) "EUC-TW" + +-- Iteration 48 -- +string(6) "EUC-TW" +bool(true) +string(5) "BIG-5" + +-- Iteration 49 -- +string(5) "BIG-5" +bool(true) +string(5) "BIG-5" + +-- Iteration 50 -- +string(5) "BIG-5" +bool(true) +string(6) "EUC-KR" + +-- Iteration 51 -- +string(6) "EUC-KR" +bool(true) +string(3) "UHC" + +-- Iteration 52 -- +string(3) "UHC" +bool(true) +string(11) "ISO-2022-KR" + +-- Iteration 53 -- +string(11) "ISO-2022-KR" +bool(true) +string(12) "Windows-1251" + +-- Iteration 54 -- +string(12) "Windows-1251" +bool(true) +string(12) "Windows-1252" + +-- Iteration 55 -- +string(12) "Windows-1252" +bool(true) +string(5) "CP866" + +-- Iteration 56 -- +string(5) "CP866" +bool(true) +string(6) "KOI8-R" +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_regex_encoding_basic.phpt b/ext/mbstring/tests/mb_regex_encoding_basic.phpt new file mode 100644 index 00000000000..a0a41e96773 --- /dev/null +++ b/ext/mbstring/tests/mb_regex_encoding_basic.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test mb_regex_encoding() function : basic functionality +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_regex_encoding() : basic functionality *** +string(%d) "%s" +bool(true) +string(5) "UTF-8" +Done diff --git a/ext/mbstring/tests/mb_regex_encoding_error1.phpt b/ext/mbstring/tests/mb_regex_encoding_error1.phpt new file mode 100644 index 00000000000..6fe19aa9de5 --- /dev/null +++ b/ext/mbstring/tests/mb_regex_encoding_error1.phpt @@ -0,0 +1,36 @@ +--TEST-- +Test mb_regex_encoding() function : error conditions - pass incorrect number of args +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_regex_encoding() : error conditions *** + +-- Testing mb_regex_encoding() function with more than expected no. of arguments -- + +Warning: Wrong parameter count for mb_regex_encoding() in %s on line %d +NULL +Done diff --git a/ext/mbstring/tests/mb_regex_encoding_error2.phpt b/ext/mbstring/tests/mb_regex_encoding_error2.phpt new file mode 100644 index 00000000000..c752609daf3 --- /dev/null +++ b/ext/mbstring/tests/mb_regex_encoding_error2.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test mb_regex_encoding() function : error conditions - Pass an unknown encoding +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_regex_encoding() : error conditions *** + +Warning: mb_regex_encoding(): Unknown encoding "unknown" in %s on line %d +bool(false) +Done diff --git a/ext/mbstring/tests/mb_regex_encoding_variation1.phpt b/ext/mbstring/tests/mb_regex_encoding_variation1.phpt new file mode 100644 index 00000000000..0d2ff99ac45 --- /dev/null +++ b/ext/mbstring/tests/mb_regex_encoding_variation1.phpt @@ -0,0 +1,215 @@ +--TEST-- +Test mb_regex_encoding() function : usage variations - Pass different data types as $encoding arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_regex_encoding() : usage variations *** + +-- Iteration 1 -- + +Warning: mb_regex_encoding(): Unknown encoding "0" in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: mb_regex_encoding(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: mb_regex_encoding(): Unknown encoding "12345" in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: mb_regex_encoding(): Unknown encoding "-2345" in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: mb_regex_encoding(): Unknown encoding "10.5" in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: mb_regex_encoding(): Unknown encoding "-10.5" in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: mb_regex_encoding(): Unknown encoding "123456789000" in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: mb_regex_encoding(): Unknown encoding "1.23456789E-9" in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: mb_regex_encoding(): Unknown encoding "0.5" in %s on line %d +bool(false) + +-- Iteration 10 -- + +Warning: mb_regex_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: mb_regex_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 12 -- + +Warning: mb_regex_encoding(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: mb_regex_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 14 -- + +Warning: mb_regex_encoding(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: mb_regex_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: mb_regex_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: mb_regex_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 18 -- +bool(true) + +-- Iteration 19 -- +bool(true) + +-- Iteration 20 -- +bool(true) + +-- Iteration 21 -- +bool(true) + +-- Iteration 22 -- + +Warning: mb_regex_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 23 -- + +Warning: mb_regex_encoding(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: mb_regex_encoding(): Unknown encoding "Resource id #%d" in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strlen_basic.phpt b/ext/mbstring/tests/mb_strlen_basic.phpt new file mode 100644 index 00000000000..6214f3069ca --- /dev/null +++ b/ext/mbstring/tests/mb_strlen_basic.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test mb_strlen() function : basic functionality +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strlen() : basic functionality*** + +-- ASCII String -- +int(7) + +-- Multibyte String -- +int(21) + +Done diff --git a/ext/mbstring/tests/mb_strlen_error1.phpt b/ext/mbstring/tests/mb_strlen_error1.phpt new file mode 100644 index 00000000000..8fcd87ec3af --- /dev/null +++ b/ext/mbstring/tests/mb_strlen_error1.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test mb_strlen() function : error conditions - pass incorrect number of args +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strlen() : error conditions *** + +-- Testing mb_strlen() function with Zero arguments -- + +Warning: mb_strlen() expects at least 1 parameter, 0 given in %s on line %d +bool(false) + +-- Testing mb_strlen() function with more than expected no. of arguments -- + +Warning: mb_strlen() expects at most 2 parameters, 3 given in %s on line %d +bool(false) +Done diff --git a/ext/mbstring/tests/mb_strlen_error2.phpt b/ext/mbstring/tests/mb_strlen_error2.phpt new file mode 100644 index 00000000000..a530a844173 --- /dev/null +++ b/ext/mbstring/tests/mb_strlen_error2.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test mb_strlen() function : error conditions - pass an unknown encoding +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strlen() : error *** + +Warning: mb_strlen(): Unknown encoding "unknown-encoding" in %s on line %d +bool(false) +Done diff --git a/ext/mbstring/tests/mb_strlen_variation1.phpt b/ext/mbstring/tests/mb_strlen_variation1.phpt new file mode 100644 index 00000000000..a64fad17e5b --- /dev/null +++ b/ext/mbstring/tests/mb_strlen_variation1.phpt @@ -0,0 +1,180 @@ +--TEST-- +Test mb_strlen() function : usage variations - Pass different data types as $str arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strlen() : usage variations *** + +-- Iteration 1 -- +int(1) + +-- Iteration 2 -- +int(1) + +-- Iteration 3 -- +int(5) + +-- Iteration 4 -- +int(5) + +-- Iteration 5 -- +int(4) + +-- Iteration 6 -- +int(5) + +-- Iteration 7 -- +int(12) + +-- Iteration 8 -- +int(13) + +-- Iteration 9 -- +int(3) + +-- Iteration 10 -- +int(0) + +-- Iteration 11 -- +int(0) + +-- Iteration 12 -- +int(1) + +-- Iteration 13 -- +int(0) + +-- Iteration 14 -- +int(1) + +-- Iteration 15 -- +int(0) + +-- Iteration 16 -- +int(0) + +-- Iteration 17 -- +int(0) + +-- Iteration 18 -- +int(6) + +-- Iteration 19 -- +int(6) + +-- Iteration 20 -- +int(11) + +-- Iteration 21 -- +int(14) + +-- Iteration 22 -- +int(0) + +-- Iteration 23 -- +int(0) + +-- Iteration 24 -- + +Warning: mb_strlen() expects parameter 1 to be string, resource given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strlen_variation2.phpt b/ext/mbstring/tests/mb_strlen_variation2.phpt new file mode 100644 index 00000000000..d34f3cfcbd1 --- /dev/null +++ b/ext/mbstring/tests/mb_strlen_variation2.phpt @@ -0,0 +1,220 @@ +--TEST-- +Test mb_strlen() function : usage variations - Pass different data types as $encoding arg +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strlen() : usage variations *** + +-- Iteration 1 -- + +Warning: mb_strlen(): Unknown encoding "0" in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: mb_strlen(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: mb_strlen(): Unknown encoding "12345" in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: mb_strlen(): Unknown encoding "-2345" in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: mb_strlen(): Unknown encoding "10.5" in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: mb_strlen(): Unknown encoding "-10.5" in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: mb_strlen(): Unknown encoding "123456789000" in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: mb_strlen(): Unknown encoding "1.23456789E-9" in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: mb_strlen(): Unknown encoding "0.5" in %s on line %d +bool(false) + +-- Iteration 10 -- + +Warning: mb_strlen(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: mb_strlen(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 12 -- + +Warning: mb_strlen(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: mb_strlen(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 14 -- + +Warning: mb_strlen(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: mb_strlen(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: mb_strlen(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: mb_strlen(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 18 -- +int(12) + +-- Iteration 19 -- +int(12) + +-- Iteration 20 -- +int(12) + +-- Iteration 21 -- +int(12) + +-- Iteration 22 -- + +Warning: mb_strlen(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 23 -- + +Warning: mb_strlen(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: mb_strlen() expects parameter 2 to be string, resource given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strlen_variation3.phpt b/ext/mbstring/tests/mb_strlen_variation3.phpt new file mode 100644 index 00000000000..13dc9099380 --- /dev/null +++ b/ext/mbstring/tests/mb_strlen_variation3.phpt @@ -0,0 +1,445 @@ +--TEST-- +Test mb_strlen() function : usage variations - Pass list of encodings +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strlen() : usage variations *** + +-- Iteration 1: UCS-4 -- +-- ASCII String -- +Encoding UCS-4 recognised +-- Multibyte String -- +Encoding UCS-4 recognised + +-- Iteration 2: UCS-4BE -- +-- ASCII String -- +Encoding UCS-4BE recognised +-- Multibyte String -- +Encoding UCS-4BE recognised + +-- Iteration 3: UCS-4LE -- +-- ASCII String -- +Encoding UCS-4LE recognised +-- Multibyte String -- +Encoding UCS-4LE recognised + +-- Iteration 4: UCS-2 -- +-- ASCII String -- +Encoding UCS-2 recognised +-- Multibyte String -- +Encoding UCS-2 recognised + +-- Iteration 5: UCS-2BE -- +-- ASCII String -- +Encoding UCS-2BE recognised +-- Multibyte String -- +Encoding UCS-2BE recognised + +-- Iteration 6: UCS-2LE -- +-- ASCII String -- +Encoding UCS-2LE recognised +-- Multibyte String -- +Encoding UCS-2LE recognised + +-- Iteration 7: UTF-32 -- +-- ASCII String -- +Encoding UTF-32 recognised +-- Multibyte String -- +Encoding UTF-32 recognised + +-- Iteration 8: UTF-32BE -- +-- ASCII String -- +Encoding UTF-32BE recognised +-- Multibyte String -- +Encoding UTF-32BE recognised + +-- Iteration 9: UTF-32LE -- +-- ASCII String -- +Encoding UTF-32LE recognised +-- Multibyte String -- +Encoding UTF-32LE recognised + +-- Iteration 10: UTF-16 -- +-- ASCII String -- +Encoding UTF-16 recognised +-- Multibyte String -- +Encoding UTF-16 recognised + +-- Iteration 11: UTF-16BE -- +-- ASCII String -- +Encoding UTF-16BE recognised +-- Multibyte String -- +Encoding UTF-16BE recognised + +-- Iteration 12: UTF-16LE -- +-- ASCII String -- +Encoding UTF-16LE recognised +-- Multibyte String -- +Encoding UTF-16LE recognised + +-- Iteration 13: UTF-7 -- +-- ASCII String -- +Encoding UTF-7 recognised +-- Multibyte String -- +Encoding UTF-7 recognised + +-- Iteration 14: UTF7-IMAP -- +-- ASCII String -- +Encoding UTF7-IMAP recognised +-- Multibyte String -- +Encoding UTF7-IMAP recognised + +-- Iteration 15: UTF-8 -- +-- ASCII String -- +Encoding UTF-8 recognised +-- Multibyte String -- +Encoding UTF-8 recognised + +-- Iteration 16: ASCII -- +-- ASCII String -- +Encoding ASCII recognised +-- Multibyte String -- +Encoding ASCII recognised + +-- Iteration 17: EUC-JP -- +-- ASCII String -- +Encoding EUC-JP recognised +-- Multibyte String -- +Encoding EUC-JP recognised + +-- Iteration 18: SJIS -- +-- ASCII String -- +Encoding SJIS recognised +-- Multibyte String -- +Encoding SJIS recognised + +-- Iteration 19: eucJP-win -- +-- ASCII String -- +Encoding eucJP-win recognised +-- Multibyte String -- +Encoding eucJP-win recognised + +-- Iteration 20: SJIS-win -- +-- ASCII String -- +Encoding SJIS-win recognised +-- Multibyte String -- +Encoding SJIS-win recognised + +-- Iteration 21: ISO-2022-JP -- +-- ASCII String -- +Encoding ISO-2022-JP recognised +-- Multibyte String -- +Encoding ISO-2022-JP recognised + +-- Iteration 22: JIS -- +-- ASCII String -- +Encoding JIS recognised +-- Multibyte String -- +Encoding JIS recognised + +-- Iteration 23: ISO-8859-1 -- +-- ASCII String -- +Encoding ISO-8859-1 recognised +-- Multibyte String -- +Encoding ISO-8859-1 recognised + +-- Iteration 24: ISO-8859-2 -- +-- ASCII String -- +Encoding ISO-8859-2 recognised +-- Multibyte String -- +Encoding ISO-8859-2 recognised + +-- Iteration 25: ISO-8859-3 -- +-- ASCII String -- +Encoding ISO-8859-3 recognised +-- Multibyte String -- +Encoding ISO-8859-3 recognised + +-- Iteration 26: ISO-8859-4 -- +-- ASCII String -- +Encoding ISO-8859-4 recognised +-- Multibyte String -- +Encoding ISO-8859-4 recognised + +-- Iteration 27: ISO-8859-5 -- +-- ASCII String -- +Encoding ISO-8859-5 recognised +-- Multibyte String -- +Encoding ISO-8859-5 recognised + +-- Iteration 28: ISO-8859-6 -- +-- ASCII String -- +Encoding ISO-8859-6 recognised +-- Multibyte String -- +Encoding ISO-8859-6 recognised + +-- Iteration 29: ISO-8859-7 -- +-- ASCII String -- +Encoding ISO-8859-7 recognised +-- Multibyte String -- +Encoding ISO-8859-7 recognised + +-- Iteration 30: ISO-8859-8 -- +-- ASCII String -- +Encoding ISO-8859-8 recognised +-- Multibyte String -- +Encoding ISO-8859-8 recognised + +-- Iteration 31: ISO-8859-9 -- +-- ASCII String -- +Encoding ISO-8859-9 recognised +-- Multibyte String -- +Encoding ISO-8859-9 recognised + +-- Iteration 32: ISO-8859-10 -- +-- ASCII String -- +Encoding ISO-8859-10 recognised +-- Multibyte String -- +Encoding ISO-8859-10 recognised + +-- Iteration 33: ISO-8859-13 -- +-- ASCII String -- +Encoding ISO-8859-13 recognised +-- Multibyte String -- +Encoding ISO-8859-13 recognised + +-- Iteration 34: ISO-8859-14 -- +-- ASCII String -- +Encoding ISO-8859-14 recognised +-- Multibyte String -- +Encoding ISO-8859-14 recognised + +-- Iteration 35: ISO-8859-15 -- +-- ASCII String -- +Encoding ISO-8859-15 recognised +-- Multibyte String -- +Encoding ISO-8859-15 recognised + +-- Iteration 36: byte2be -- +-- ASCII String -- +Encoding byte2be recognised +-- Multibyte String -- +Encoding byte2be recognised + +-- Iteration 37: byte2le -- +-- ASCII String -- +Encoding byte2le recognised +-- Multibyte String -- +Encoding byte2le recognised + +-- Iteration 38: byte4be -- +-- ASCII String -- +Encoding byte4be recognised +-- Multibyte String -- +Encoding byte4be recognised + +-- Iteration 39: byte4le -- +-- ASCII String -- +Encoding byte4le recognised +-- Multibyte String -- +Encoding byte4le recognised + +-- Iteration 40: BASE64 -- +-- ASCII String -- +Encoding BASE64 recognised +-- Multibyte String -- +Encoding BASE64 recognised + +-- Iteration 41: HTML-ENTITIES -- +-- ASCII String -- +Encoding HTML-ENTITIES recognised +-- Multibyte String -- +Encoding HTML-ENTITIES recognised + +-- Iteration 42: 7bit -- +-- ASCII String -- +Encoding 7bit recognised +-- Multibyte String -- +Encoding 7bit recognised + +-- Iteration 43: 8bit -- +-- ASCII String -- +Encoding 8bit recognised +-- Multibyte String -- +Encoding 8bit recognised + +-- Iteration 44: EUC-CN -- +-- ASCII String -- +Encoding EUC-CN recognised +-- Multibyte String -- +Encoding EUC-CN recognised + +-- Iteration 45: CP936 -- +-- ASCII String -- +Encoding CP936 recognised +-- Multibyte String -- +Encoding CP936 recognised + +-- Iteration 46: HZ -- +-- ASCII String -- +Encoding HZ recognised +-- Multibyte String -- +Encoding HZ recognised + +-- Iteration 47: EUC-TW -- +-- ASCII String -- +Encoding EUC-TW recognised +-- Multibyte String -- +Encoding EUC-TW recognised + +-- Iteration 48: CP950 -- +-- ASCII String -- +Encoding CP950 recognised +-- Multibyte String -- +Encoding CP950 recognised + +-- Iteration 49: BIG-5 -- +-- ASCII String -- +Encoding BIG-5 recognised +-- Multibyte String -- +Encoding BIG-5 recognised + +-- Iteration 50: EUC-KR -- +-- ASCII String -- +Encoding EUC-KR recognised +-- Multibyte String -- +Encoding EUC-KR recognised + +-- Iteration 51: UHC -- +-- ASCII String -- +Encoding UHC recognised +-- Multibyte String -- +Encoding UHC recognised + +-- Iteration 52: ISO-2022-KR -- +-- ASCII String -- +Encoding ISO-2022-KR recognised +-- Multibyte String -- +Encoding ISO-2022-KR recognised + +-- Iteration 53: Windows-1251 -- +-- ASCII String -- +Encoding Windows-1251 recognised +-- Multibyte String -- +Encoding Windows-1251 recognised + +-- Iteration 54: Windows-1252 -- +-- ASCII String -- +Encoding Windows-1252 recognised +-- Multibyte String -- +Encoding Windows-1252 recognised + +-- Iteration 55: CP866 -- +-- ASCII String -- +Encoding CP866 recognised +-- Multibyte String -- +Encoding CP866 recognised + +-- Iteration 56: KOI8-R -- +-- ASCII String -- +Encoding KOI8-R recognised +-- Multibyte String -- +Encoding KOI8-R recognised +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strpos_basic.phpt b/ext/mbstring/tests/mb_strpos_basic.phpt new file mode 100644 index 00000000000..4284ab805e9 --- /dev/null +++ b/ext/mbstring/tests/mb_strpos_basic.phpt @@ -0,0 +1,57 @@ +--TEST-- +Test mb_strpos() function : basic functionality +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strpos() : basic functionality*** + +-- ASCII string 1 -- +int(4) + +-- ASCII string 2 -- +bool(false) + +-- Multibyte string 1 -- +int(0) + +-- Multibyte string 2 -- +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strpos_error1.phpt b/ext/mbstring/tests/mb_strpos_error1.phpt new file mode 100644 index 00000000000..8f5ba85423e --- /dev/null +++ b/ext/mbstring/tests/mb_strpos_error1.phpt @@ -0,0 +1,50 @@ +--TEST-- +Test mb_strpos() function : error conditions - Pass incorrect number of args +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strpos() : error conditions *** + +-- Testing mb_strpos() function with more than expected no. of arguments -- + +Warning: mb_strpos() expects at most 4 parameters, 5 given in %s on line %d +bool(false) + +-- Testing mb_strpos() function with less than expected no. of arguments -- + +Warning: mb_strpos() expects at least 2 parameters, 1 given in %s on line %d +bool(false) +Done diff --git a/ext/mbstring/tests/mb_strpos_error2.phpt b/ext/mbstring/tests/mb_strpos_error2.phpt new file mode 100644 index 00000000000..f75390f2c52 --- /dev/null +++ b/ext/mbstring/tests/mb_strpos_error2.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test mb_strpos() function : error conditions - Pass unknown encoding +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strpos() : error conditions *** + +Warning: mb_strpos(): Unknown encoding "unknown-encoding" in %s on line %d +bool(false) +Done diff --git a/ext/mbstring/tests/mb_strpos_variation1.phpt b/ext/mbstring/tests/mb_strpos_variation1.phpt new file mode 100644 index 00000000000..61f534791c6 --- /dev/null +++ b/ext/mbstring/tests/mb_strpos_variation1.phpt @@ -0,0 +1,182 @@ +--TEST-- +Test mb_strpos() function : usage variations - pass different data types to $haystack arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strpos() : usage variations *** + +-- Iteration 1 -- +bool(false) + +-- Iteration 2 -- +bool(false) + +-- Iteration 3 -- +bool(false) + +-- Iteration 4 -- +bool(false) + +-- Iteration 5 -- +bool(false) + +-- Iteration 6 -- +bool(false) + +-- Iteration 7 -- +bool(false) + +-- Iteration 8 -- +bool(false) + +-- Iteration 9 -- +bool(false) + +-- Iteration 10 -- +bool(false) + +-- Iteration 11 -- +bool(false) + +-- Iteration 12 -- +bool(false) + +-- Iteration 13 -- +bool(false) + +-- Iteration 14 -- +bool(false) + +-- Iteration 15 -- +bool(false) + +-- Iteration 16 -- +bool(false) + +-- Iteration 17 -- +bool(false) + +-- Iteration 18 -- +bool(false) + +-- Iteration 19 -- +bool(false) + +-- Iteration 20 -- +bool(false) + +-- Iteration 21 -- +bool(false) + +-- Iteration 22 -- +bool(false) + +-- Iteration 23 -- +bool(false) + +-- Iteration 24 -- + +Warning: mb_strpos() expects parameter 1 to be string, resource given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strpos_variation2.phpt b/ext/mbstring/tests/mb_strpos_variation2.phpt new file mode 100644 index 00000000000..ed62ea8aa3e --- /dev/null +++ b/ext/mbstring/tests/mb_strpos_variation2.phpt @@ -0,0 +1,198 @@ +--TEST-- +Test mb_strpos() function : usage variations - pass different data types as $needle arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strpos() : usage variations *** + +-- Iteration 1 -- +bool(false) + +-- Iteration 2 -- +bool(false) + +-- Iteration 3 -- +bool(false) + +-- Iteration 4 -- +bool(false) + +-- Iteration 5 -- +bool(false) + +-- Iteration 6 -- +bool(false) + +-- Iteration 7 -- +bool(false) + +-- Iteration 8 -- +bool(false) + +-- Iteration 9 -- +bool(false) + +-- Iteration 10 -- + +Warning: mb_strpos(): Empty delimiter. in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: mb_strpos(): Empty delimiter. in %s on line %d +bool(false) + +-- Iteration 12 -- +bool(false) + +-- Iteration 13 -- + +Warning: mb_strpos(): Empty delimiter. in %s on line %d +bool(false) + +-- Iteration 14 -- +bool(false) + +-- Iteration 15 -- + +Warning: mb_strpos(): Empty delimiter. in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: mb_strpos(): Empty delimiter. in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: mb_strpos(): Empty delimiter. in %s on line %d +bool(false) + +-- Iteration 18 -- +int(0) + +-- Iteration 19 -- +int(0) + +-- Iteration 20 -- +bool(false) + +-- Iteration 21 -- +bool(false) + +-- Iteration 22 -- + +Warning: mb_strpos(): Empty delimiter. in %s on line %d +bool(false) + +-- Iteration 23 -- + +Warning: mb_strpos(): Empty delimiter. in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: mb_strpos() expects parameter 2 to be string, resource given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strpos_variation3.phpt b/ext/mbstring/tests/mb_strpos_variation3.phpt new file mode 100644 index 00000000000..8f8540ee858 --- /dev/null +++ b/ext/mbstring/tests/mb_strpos_variation3.phpt @@ -0,0 +1,202 @@ +--TEST-- +Test mb_strpos() function : usage variations - pass different data types as $offset arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strpos() : usage variations *** + +-- Iteration 1 -- +int(8) + +-- Iteration 2 -- +int(8) + +-- Iteration 3 -- + +Warning: mb_strpos(): Offset not contained in string. in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: mb_strpos(): Offset not contained in string. in %s on line %d +bool(false) + +-- Iteration 5 -- +bool(false) + +-- Iteration 6 -- + +Warning: mb_strpos(): Offset not contained in string. in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: mb_strpos(): Offset not contained in string. in %s on line %d +bool(false) + +-- Iteration 8 -- +int(8) + +-- Iteration 9 -- +int(8) + +-- Iteration 10 -- +int(8) + +-- Iteration 11 -- +int(8) + +-- Iteration 12 -- +int(8) + +-- Iteration 13 -- +int(8) + +-- Iteration 14 -- +int(8) + +-- Iteration 15 -- +int(8) + +-- Iteration 16 -- + +Warning: mb_strpos() expects parameter 3 to be long, string given in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: mb_strpos() expects parameter 3 to be long, string given in %s on line %d +bool(false) + +-- Iteration 18 -- + +Warning: mb_strpos() expects parameter 3 to be long, string given in %s on line %d +bool(false) + +-- Iteration 19 -- + +Warning: mb_strpos() expects parameter 3 to be long, string given in %s on line %d +bool(false) + +-- Iteration 20 -- + +Warning: mb_strpos() expects parameter 3 to be long, string given in %s on line %d +bool(false) + +-- Iteration 21 -- + +Warning: mb_strpos() expects parameter 3 to be long, object given in %s on line %d +bool(false) + +-- Iteration 22 -- +int(8) + +-- Iteration 23 -- +int(8) + +-- Iteration 24 -- + +Warning: mb_strpos() expects parameter 3 to be long, resource given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strpos_variation4.phpt b/ext/mbstring/tests/mb_strpos_variation4.phpt new file mode 100644 index 00000000000..ac818c6610e --- /dev/null +++ b/ext/mbstring/tests/mb_strpos_variation4.phpt @@ -0,0 +1,222 @@ +--TEST-- +Test mb_strpos() function : usage variations - pass different data types as $encoding arg +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strpos() : usage variations *** + +-- Iteration 1 -- + +Warning: mb_strpos(): Unknown encoding "0" in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: mb_strpos(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: mb_strpos(): Unknown encoding "12345" in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: mb_strpos(): Unknown encoding "-2345" in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: mb_strpos(): Unknown encoding "10.5" in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: mb_strpos(): Unknown encoding "-10.5" in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: mb_strpos(): Unknown encoding "123456789000" in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: mb_strpos(): Unknown encoding "1.23456789E-9" in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: mb_strpos(): Unknown encoding "0.5" in %s on line %d +bool(false) + +-- Iteration 10 -- + +Warning: mb_strpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: mb_strpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 12 -- + +Warning: mb_strpos(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: mb_strpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 14 -- + +Warning: mb_strpos(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: mb_strpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: mb_strpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: mb_strpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 18 -- +int(7) + +-- Iteration 19 -- +int(7) + +-- Iteration 20 -- +int(7) + +-- Iteration 21 -- +int(7) + +-- Iteration 22 -- + +Warning: mb_strpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 23 -- + +Warning: mb_strpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: mb_strpos() expects parameter 4 to be string, resource given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strrpos_basic.phpt b/ext/mbstring/tests/mb_strrpos_basic.phpt new file mode 100644 index 00000000000..9de0388f436 --- /dev/null +++ b/ext/mbstring/tests/mb_strrpos_basic.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test mb_strrpos() function : basic functionality +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strrpos() : basic *** + +-- ASCII string 1 -- +int(15) + +-- ASCII string 2 -- +bool(false) + +-- Multibyte string 1 -- +int(20) + +-- Multibyte string 2 -- +bool(false) +Done + diff --git a/ext/mbstring/tests/mb_strrpos_error1.phpt b/ext/mbstring/tests/mb_strrpos_error1.phpt new file mode 100644 index 00000000000..727ef569f53 --- /dev/null +++ b/ext/mbstring/tests/mb_strrpos_error1.phpt @@ -0,0 +1,50 @@ +--TEST-- +Test mb_strrpos() function : error conditions - pass incorrect number of args +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strrpos() : error conditions *** + +-- Testing mb_strrpos() function with more than expected no. of arguments -- + +Warning: mb_strrpos() expects at most 4 parameters, 5 given in %s on line %d +bool(false) + +-- Testing mb_strrpos() function with less than expected no. of arguments -- + +Warning: mb_strrpos() expects at least 2 parameters, 1 given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strrpos_error2.phpt b/ext/mbstring/tests/mb_strrpos_error2.phpt new file mode 100644 index 00000000000..8247d370d5c --- /dev/null +++ b/ext/mbstring/tests/mb_strrpos_error2.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test mb_strrpos() function : error conditions - pass an unknown encoding +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strrpos() : error conditions *** + +Warning: mb_strrpos(): Unknown encoding "unknown-encoding" in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strrpos_variation1.phpt b/ext/mbstring/tests/mb_strrpos_variation1.phpt new file mode 100644 index 00000000000..922cb73fdd0 --- /dev/null +++ b/ext/mbstring/tests/mb_strrpos_variation1.phpt @@ -0,0 +1,181 @@ +--TEST-- +Test mb_strrpos() function : usage variations - pass different data types to $haystack arg +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strrpos() : usage variations *** + +-- Iteration 1 -- +bool(false) + +-- Iteration 2 -- +bool(false) + +-- Iteration 3 -- +bool(false) + +-- Iteration 4 -- +bool(false) + +-- Iteration 5 -- +bool(false) + +-- Iteration 6 -- +bool(false) + +-- Iteration 7 -- +bool(false) + +-- Iteration 8 -- +bool(false) + +-- Iteration 9 -- +bool(false) + +-- Iteration 10 -- +bool(false) + +-- Iteration 11 -- +bool(false) + +-- Iteration 12 -- +bool(false) + +-- Iteration 13 -- +bool(false) + +-- Iteration 14 -- +bool(false) + +-- Iteration 15 -- +bool(false) + +-- Iteration 16 -- +bool(false) + +-- Iteration 17 -- +bool(false) + +-- Iteration 18 -- +int(7) + +-- Iteration 19 -- +int(7) + +-- Iteration 20 -- +int(7) + +-- Iteration 21 -- +int(7) + +-- Iteration 22 -- +bool(false) + +-- Iteration 23 -- +bool(false) + +-- Iteration 24 -- + +Warning: mb_strrpos() expects parameter 1 to be string, resource given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strrpos_variation2.phpt b/ext/mbstring/tests/mb_strrpos_variation2.phpt new file mode 100644 index 00000000000..4986096c702 --- /dev/null +++ b/ext/mbstring/tests/mb_strrpos_variation2.phpt @@ -0,0 +1,183 @@ +--TEST-- +Test mb_strrpos() function : usage variations - Pass different data types to $needle arg +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strrpos() : usage variations *** + +-- Iteration 1 -- +bool(false) + +-- Iteration 2 -- +bool(false) + +-- Iteration 3 -- +bool(false) + +-- Iteration 4 -- +bool(false) + +-- Iteration 5 -- +bool(false) + +-- Iteration 6 -- +bool(false) + +-- Iteration 7 -- +bool(false) + +-- Iteration 8 -- +bool(false) + +-- Iteration 9 -- +bool(false) + +-- Iteration 10 -- +bool(false) + +-- Iteration 11 -- +bool(false) + +-- Iteration 12 -- +bool(false) + +-- Iteration 13 -- +bool(false) + +-- Iteration 14 -- +bool(false) + +-- Iteration 15 -- +bool(false) + +-- Iteration 16 -- +bool(false) + +-- Iteration 17 -- +bool(false) + +-- Iteration 18 -- +int(7) + +-- Iteration 19 -- +int(7) + +-- Iteration 20 -- +int(7) + +-- Iteration 21 -- +int(7) + +-- Iteration 22 -- +bool(false) + +-- Iteration 23 -- +bool(false) + +-- Iteration 24 -- + +Warning: mb_strrpos() expects parameter 2 to be string, resource given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strrpos_variation3.phpt b/ext/mbstring/tests/mb_strrpos_variation3.phpt new file mode 100644 index 00000000000..fbd0c68aa78 --- /dev/null +++ b/ext/mbstring/tests/mb_strrpos_variation3.phpt @@ -0,0 +1,147 @@ +--TEST-- +Test mb_strrpos() function : usage variations - Pass different data types as $offset arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strrpos() : usage variations *** + +-- Iteration 1 -- +int(8) + +-- Iteration 2 -- +int(8) + +-- Iteration 3 -- +bool(false) + +-- Iteration 4 -- +bool(false) + +-- Iteration 5 -- +bool(false) + +-- Iteration 6 -- +bool(false) + +-- Iteration 7 -- +bool(false) + +-- Iteration 8 -- +int(8) + +-- Iteration 9 -- +int(8) + +-- Iteration 10 -- +int(8) + +-- Iteration 11 -- +int(8) + +-- Iteration 12 -- +int(8) + +-- Iteration 13 -- +int(8) + +-- Iteration 14 -- +int(8) + +-- Iteration 15 -- +int(8) + +-- Iteration 16 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +int(8) + +-- Iteration 17 -- +int(8) + +-- Iteration 18 -- +int(8) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strrpos_variation4.phpt b/ext/mbstring/tests/mb_strrpos_variation4.phpt new file mode 100644 index 00000000000..e3d3d43c087 --- /dev/null +++ b/ext/mbstring/tests/mb_strrpos_variation4.phpt @@ -0,0 +1,222 @@ +--TEST-- +Test mb_strrpos() function : usage variations - pass different data types as $encoding arg +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strrpos() : usage variations *** + +-- Iteration 1 -- + +Warning: mb_strrpos(): Unknown encoding "0" in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: mb_strrpos(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: mb_strrpos(): Unknown encoding "12345" in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: mb_strrpos(): Unknown encoding "-2345" in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: mb_strrpos(): Unknown encoding "10.5" in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: mb_strrpos(): Unknown encoding "-10.5" in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: mb_strrpos(): Unknown encoding "123456789000" in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: mb_strrpos(): Unknown encoding "1.23456789E-9" in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: mb_strrpos(): Unknown encoding "0.5" in %s on line %d +bool(false) + +-- Iteration 10 -- + +Warning: mb_strrpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: mb_strrpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 12 -- + +Warning: mb_strrpos(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: mb_strrpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 14 -- + +Warning: mb_strrpos(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: mb_strrpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: mb_strrpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: mb_strrpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 18 -- +int(7) + +-- Iteration 19 -- +int(7) + +-- Iteration 20 -- +int(7) + +-- Iteration 21 -- +int(7) + +-- Iteration 22 -- + +Warning: mb_strrpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 23 -- + +Warning: mb_strrpos(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: mb_strrpos() expects parameter 4 to be string, resource given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strrpos_variation5.phpt b/ext/mbstring/tests/mb_strrpos_variation5.phpt new file mode 100644 index 00000000000..8fdd40da399 --- /dev/null +++ b/ext/mbstring/tests/mb_strrpos_variation5.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test mb_strrpos() function : usage variations - pass encoding as third argument (deprecated behaviour) +--SKIPIF-- + +--FILE-- + "utf-8", + 'Single Quoted String' => 'utf-8', + 'Heredoc' => $stringh); +foreach ($inputs as $type => $input) { + echo "\n-- $type --\n"; + echo "-- With fourth encoding argument --\n"; + var_dump(mb_strrpos($string_mb, $needle_mb, $input, 'utf-8')); + echo "-- Without fourth encoding argument --\n"; + var_dump(mb_strrpos($string_mb, $needle_mb, $input)); +} + +echo "Done"; +?> +--EXPECTF-- +*** Testing mb_strrpos() : usage variations *** + +-- Double Quoted String -- +-- With fourth encoding argument -- +int(20) +-- Without fourth encoding argument -- +int(20) + +-- Single Quoted String -- +-- With fourth encoding argument -- +int(20) +-- Without fourth encoding argument -- +int(20) + +-- Heredoc -- +-- With fourth encoding argument -- +int(20) +-- Without fourth encoding argument -- +int(20) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtolower_basic.phpt b/ext/mbstring/tests/mb_strtolower_basic.phpt new file mode 100644 index 00000000000..b1d31e2bc1f --- /dev/null +++ b/ext/mbstring/tests/mb_strtolower_basic.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test mb_strtolower() function : basic functionality +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strtolower() : basic functionality*** + +-- ASCII String -- +string(26) "abcdefghijklmnopqrstuvwxyz" +Correctly converted + +-- Multibyte String -- +string(64) "zrHOss6zzrTOtc62zrfOuM65zrrOu868zr3Ovs6/z4DPgc+Dz4TPhc+Gz4fPiM+J" +Correctly converted +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtolower_error1.phpt b/ext/mbstring/tests/mb_strtolower_error1.phpt new file mode 100644 index 00000000000..13cdd3ce725 --- /dev/null +++ b/ext/mbstring/tests/mb_strtolower_error1.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test mb_strtolower() function : error conditions - pass incorrect number of arguments +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strtolower() : error conditions*** + +-- Testing mb_strtolower() function with more than expected no. of arguments -- + +Warning: mb_strtolower() expects at most 2 parameters, 3 given in %s on line %d +NULL + +-- Testing mb_strtolower() function with zero arguments -- + +Warning: mb_strtolower() expects at least 1 parameter, 0 given in %s on line %d +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtolower_error2.phpt b/ext/mbstring/tests/mb_strtolower_error2.phpt new file mode 100644 index 00000000000..d048fef70dc --- /dev/null +++ b/ext/mbstring/tests/mb_strtolower_error2.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test mb_strtolower() function : error conditions - pass an unknown encoding +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strtolower() : error conditions*** + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtolower(): Unknown encoding "unknown-encoding" in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtolower_variation1.phpt b/ext/mbstring/tests/mb_strtolower_variation1.phpt new file mode 100644 index 00000000000..ac468ca0d9e --- /dev/null +++ b/ext/mbstring/tests/mb_strtolower_variation1.phpt @@ -0,0 +1,180 @@ +--TEST-- +Test mb_strtolower() function : usage variations - pass different data types as $sourcestring arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strtolower() : usage variations *** + +-- Iteration 1 -- +string(1) "0" + +-- Iteration 2 -- +string(1) "1" + +-- Iteration 3 -- +string(5) "12345" + +-- Iteration 4 -- +string(5) "-2345" + +-- Iteration 5 -- +string(4) "10.5" + +-- Iteration 6 -- +string(5) "-10.5" + +-- Iteration 7 -- +string(12) "123456789000" + +-- Iteration 8 -- +string(13) "1.23456789e-9" + +-- Iteration 9 -- +string(3) "0.5" + +-- Iteration 10 -- +string(0) "" + +-- Iteration 11 -- +string(0) "" + +-- Iteration 12 -- +string(1) "1" + +-- Iteration 13 -- +string(0) "" + +-- Iteration 14 -- +string(1) "1" + +-- Iteration 15 -- +string(0) "" + +-- Iteration 16 -- +string(0) "" + +-- Iteration 17 -- +string(0) "" + +-- Iteration 18 -- +string(6) "string" + +-- Iteration 19 -- +string(6) "string" + +-- Iteration 20 -- +string(11) "hello world" + +-- Iteration 21 -- +string(14) "class a object" + +-- Iteration 22 -- +string(0) "" + +-- Iteration 23 -- +string(0) "" + +-- Iteration 24 -- + +Warning: mb_strtolower() expects parameter 1 to be string, resource given in %s on line %d +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtolower_variation2.phpt b/ext/mbstring/tests/mb_strtolower_variation2.phpt new file mode 100644 index 00000000000..d9eee440e7b --- /dev/null +++ b/ext/mbstring/tests/mb_strtolower_variation2.phpt @@ -0,0 +1,233 @@ +--TEST-- +Test mb_strtolower() function : usage variations - pass different data types as $encoding arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strtolower() : usage variations *** + +-- Iteration 1 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtolower(): Unknown encoding "0" in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtolower(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtolower(): Unknown encoding "12345" in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtolower(): Unknown encoding "-2345" in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtolower(): Unknown encoding "10.5" in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtolower(): Unknown encoding "-10.5" in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtolower(): Unknown encoding "123456789000" in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtolower(): Unknown encoding "1.23456789E-9" in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtolower(): Unknown encoding "0.5" in %s on line %d +bool(false) + +-- Iteration 10 -- +string(12) "hello, world" + +-- Iteration 11 -- +string(12) "hello, world" + +-- Iteration 12 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtolower(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d +string(12) "hello, world" + +-- Iteration 14 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtolower(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d +string(12) "hello, world" + +-- Iteration 16 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d +string(12) "hello, world" + +-- Iteration 17 -- + +Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d +string(12) "hello, world" + +-- Iteration 18 -- +string(12) "hello, world" + +-- Iteration 19 -- +string(12) "hello, world" + +-- Iteration 20 -- +string(12) "hello, world" + +-- Iteration 21 -- +string(12) "hello, world" + +-- Iteration 22 -- +string(12) "hello, world" + +-- Iteration 23 -- +string(12) "hello, world" + +-- Iteration 24 -- + +Warning: mb_strtolower() expects parameter 2 to be string, resource given in %s on line %d +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtolower_variation3.phpt b/ext/mbstring/tests/mb_strtolower_variation3.phpt new file mode 100644 index 00000000000..7ff3cee33ec --- /dev/null +++ b/ext/mbstring/tests/mb_strtolower_variation3.phpt @@ -0,0 +1,57 @@ +--TEST-- +Test mb_strtolower() function : usage variations - pass mixed ASCII and non-ASCII strings +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strtolower() : usage variations *** + +-- Mixed string (mulitbyte and ASCII characters) -- +string(80) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCcGhwLiAwMTIzNO+8le+8lu+8l++8mO+8meOAgg==" +Correctly Converted + +-- Multibyte Only String-- +string(40) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC" +Correctly Converted +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtolower_variation4.phpt b/ext/mbstring/tests/mb_strtolower_variation4.phpt new file mode 100644 index 00000000000..f08b508798e --- /dev/null +++ b/ext/mbstring/tests/mb_strtolower_variation4.phpt @@ -0,0 +1,56 @@ +--TEST-- +Test mb_strtolower() function : usage variations - pass different characters to check conversion is correct +--SKIPIF-- + +--FILE-- + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'Characters With Accents' => base64_decode('w4DDgcOCw4PDhMOFw4bDh8OIw4nDisOLw4zDjcOOw4/DkMORw5LDk8OUw5XDlg=='), + 'Russian' => base64_decode('0JDQkdCS0JPQlNCV0JbQlw==')); +$lowers = array('Basic Latin' => 'abcdefghijklmnopqrstuvwxyz', + 'Characters With Accents' => base64_decode('w6DDocOiw6PDpMOlw6bDp8Oow6nDqsOrw6zDrcOuw6/DsMOxw7LDs8O0w7XDtg=='), + 'Russian' => base64_decode('0LDQsdCy0LPQtNC10LbQtw==')); + +foreach ($uppers as $lang => $sourcestring) { + echo "\n-- $lang --\n"; + $a = mb_strtolower($sourcestring, 'utf-8'); + var_dump(base64_encode($a)); + if ($a == $lowers[$lang]) { + echo "Correctly Converted\n"; + } else { + echo "Incorrectly Converted\n"; + } +} + +echo "Done"; +?> + +--EXPECTF-- +*** Testing mb_strtolower() : usage variations *** + +-- Basic Latin -- +string(36) "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=" +Correctly Converted + +-- Characters With Accents -- +string(64) "w6DDocOiw6PDpMOlw6bDp8Oow6nDqsOrw6zDrcOuw6/DsMOxw7LDs8O0w7XDtg==" +Correctly Converted + +-- Russian -- +string(24) "0LDQsdCy0LPQtNC10LbQtw==" +Correctly Converted +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtoupper_basic.phpt b/ext/mbstring/tests/mb_strtoupper_basic.phpt new file mode 100644 index 00000000000..b282647f8c9 --- /dev/null +++ b/ext/mbstring/tests/mb_strtoupper_basic.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test mb_strtoupper() function : basic functionality +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strtoupper() : basic functionality *** + +-- ASCII String -- +string(26) "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +Correctly converted + +-- Multibyte String -- +string(64) "zpHOks6TzpTOlc6WzpfOmM6ZzprOm86czp3Ons6fzqDOoc6jzqTOpc6mzqfOqM6p" +Correctly converted +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtoupper_error1.phpt b/ext/mbstring/tests/mb_strtoupper_error1.phpt new file mode 100644 index 00000000000..d61c389c187 --- /dev/null +++ b/ext/mbstring/tests/mb_strtoupper_error1.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test mb_strtoupper() function : error conditions - pass incorrect number of args +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strtoupper() : error conditions *** + +-- Testing mb_strtoupper() function with more than expected no. of arguments -- + +Warning: mb_strtoupper() expects at most 2 parameters, 3 given in %s on line %d +NULL + +-- Testing mb_strtoupper() function with zero arguments -- + +Warning: mb_strtoupper() expects at least 1 parameter, 0 given in %s on line %d +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtoupper_error2.phpt b/ext/mbstring/tests/mb_strtoupper_error2.phpt new file mode 100644 index 00000000000..69e4ecdee28 --- /dev/null +++ b/ext/mbstring/tests/mb_strtoupper_error2.phpt @@ -0,0 +1,36 @@ +--TEST-- +Test mb_strtoupper() function : error conditions - pass an unknown encoding +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strtoupper() : error conditions *** + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtoupper(): Unknown encoding "unknown-encoding" in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtoupper_variation1.phpt b/ext/mbstring/tests/mb_strtoupper_variation1.phpt new file mode 100644 index 00000000000..b602f696b4b --- /dev/null +++ b/ext/mbstring/tests/mb_strtoupper_variation1.phpt @@ -0,0 +1,182 @@ +--TEST-- +Test mb_strtoupper() function : usage varitations - pass different data types as $sourcestring arg +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strtoupper() : usage variations *** + +-- Iteration 1 -- +string(1) "0" + +-- Iteration 2 -- +string(1) "1" + +-- Iteration 3 -- +string(5) "12345" + +-- Iteration 4 -- +string(5) "-2345" + +-- Iteration 5 -- +string(4) "10.5" + +-- Iteration 6 -- +string(5) "-10.5" + +-- Iteration 7 -- +string(12) "123456789000" + +-- Iteration 8 -- +string(13) "1.23456789E-9" + +-- Iteration 9 -- +string(3) "0.5" + +-- Iteration 10 -- +string(0) "" + +-- Iteration 11 -- +string(0) "" + +-- Iteration 12 -- +string(1) "1" + +-- Iteration 13 -- +string(0) "" + +-- Iteration 14 -- +string(1) "1" + +-- Iteration 15 -- +string(0) "" + +-- Iteration 16 -- +string(0) "" + +-- Iteration 17 -- +string(0) "" + +-- Iteration 18 -- +string(6) "STRING" + +-- Iteration 19 -- +string(6) "STRING" + +-- Iteration 20 -- +string(12) "HELLO, WORLD" + +-- Iteration 21 -- +string(14) "CLASS A OBJECT" + +-- Iteration 22 -- +string(0) "" + +-- Iteration 23 -- +string(0) "" + +-- Iteration 24 -- + +Warning: mb_strtoupper() expects parameter 1 to be string, resource given in %s on line %d +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtoupper_variation2.phpt b/ext/mbstring/tests/mb_strtoupper_variation2.phpt new file mode 100644 index 00000000000..d28c99551b2 --- /dev/null +++ b/ext/mbstring/tests/mb_strtoupper_variation2.phpt @@ -0,0 +1,234 @@ +--TEST-- +Test mb_strtoupper() function : usage varitations - Pass different data types as $encoding arg +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strtoupper() : usage variations *** + +-- Iteration 1 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtoupper(): Unknown encoding "0" in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtoupper(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtoupper(): Unknown encoding "12345" in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtoupper(): Unknown encoding "-2345" in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtoupper(): Unknown encoding "10.5" in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtoupper(): Unknown encoding "-10.5" in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtoupper(): Unknown encoding "123456789000" in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtoupper(): Unknown encoding "1.23456789E-9" in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtoupper(): Unknown encoding "0.5" in %s on line %d +bool(false) + +-- Iteration 10 -- +string(12) "HELLO, WORLD" + +-- Iteration 11 -- +string(12) "HELLO, WORLD" + +-- Iteration 12 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtoupper(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d +string(12) "HELLO, WORLD" + +-- Iteration 14 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d + +Warning: mb_strtoupper(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d +string(12) "HELLO, WORLD" + +-- Iteration 16 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d +string(12) "HELLO, WORLD" + +-- Iteration 17 -- + +Warning: mb_strtoupper(): Illegal character encoding specified in %s on line %d +string(12) "HELLO, WORLD" + +-- Iteration 18 -- +string(12) "HELLO, WORLD" + +-- Iteration 19 -- +string(12) "HELLO, WORLD" + +-- Iteration 20 -- +string(12) "HELLO, WORLD" + +-- Iteration 21 -- +string(12) "HELLO, WORLD" + +-- Iteration 22 -- +string(12) "HELLO, WORLD" + +-- Iteration 23 -- +string(12) "HELLO, WORLD" + +-- Iteration 24 -- + +Warning: mb_strtoupper() expects parameter 2 to be string, resource given in %s on line %d +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtoupper_variation3.phpt b/ext/mbstring/tests/mb_strtoupper_variation3.phpt new file mode 100644 index 00000000000..9b2956976a8 --- /dev/null +++ b/ext/mbstring/tests/mb_strtoupper_variation3.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test mb_strtoupper() function : usage varitations - pass mixed ASCII and non-ASCII strings +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strtoupper() : usage variations *** + +-- Mixed string (mulitbyte and ASCII characters) -- +string(80) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCUEhQLiAwMTIzNO+8le+8lu+8l++8mO+8meOAgg==" +Correctly Converted + +-- Multibyte Only String-- +string(40) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC" +Correctly Converted +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strtoupper_variation4.phpt b/ext/mbstring/tests/mb_strtoupper_variation4.phpt new file mode 100644 index 00000000000..8f5abe7269e --- /dev/null +++ b/ext/mbstring/tests/mb_strtoupper_variation4.phpt @@ -0,0 +1,57 @@ +--TEST-- +Test mb_strtoupper() function : usage varitations - Pass different character types to check conversion is correct +--SKIPIF-- + +--FILE-- + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'Characters With Accents' => base64_decode('w4DDgcOCw4PDhMOFw4bDh8OIw4nDisOLw4zDjcOOw4/DkMORw5LDk8OUw5XDlg=='), + 'Russian' => base64_decode('0JDQkdCS0JPQlNCV0JbQlw==')); +$lowers = array('Basic Latin' => 'abcdefghijklmnopqrstuvwxyz', + 'Characters With Accents' => base64_decode('w6DDocOiw6PDpMOlw6bDp8Oow6nDqsOrw6zDrcOuw6/DsMOxw7LDs8O0w7XDtg=='), + 'Russian' => base64_decode('0LDQsdCy0LPQtNC10LbQtw==')); + +foreach ($lowers as $lang => $sourcestring) { + echo "\n-- $lang --\n"; + $a = mb_strtoupper($sourcestring, 'UTF-8'); + var_dump(base64_encode($a)); + if ($a == $uppers[$lang]) { + echo "Correctly Converted\n"; + } else { + echo "Incorrectly Converted\n"; + } +} + +echo "Done"; +?> + +--EXPECTF-- +*** Testing mb_strtoupper() : usage variations *** + +-- Basic Latin -- +string(36) "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVo=" +Correctly Converted + +-- Characters With Accents -- +string(64) "w4DDgcOCw4PDhMOFw4bDh8OIw4nDisOLw4zDjcOOw4/DkMORw5LDk8OUw5XDlg==" +Correctly Converted + +-- Russian -- +string(24) "0JDQkdCS0JPQlNCV0JbQlw==" +Correctly Converted +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_substr_basic.phpt b/ext/mbstring/tests/mb_substr_basic.phpt new file mode 100644 index 00000000000..a43cf15bb58 --- /dev/null +++ b/ext/mbstring/tests/mb_substr_basic.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test mb_substr() function : basic functionality +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr() : basic functionality *** + +-- ASCII string 1 -- +string(3) "DEF" + +-- ASCII string 2 -- +string(3) "DEF" + +-- Multibyte string 1 -- +string(12) "peacrOiqng==" + +-- Multibyte string 2 -- +string(28) "6Kqe44OG44Kt44K544OI44Gn44GZ" +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_substr_count_basic.phpt b/ext/mbstring/tests/mb_substr_count_basic.phpt new file mode 100644 index 00000000000..4b8756741c5 --- /dev/null +++ b/ext/mbstring/tests/mb_substr_count_basic.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test mb_substr_count() function : basic functionality +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr_count() : basic functionality *** + +-- ASCII String -- +int(3) +int(0) + +-- Multibyte String -- +int(2) +int(0) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_substr_count_error1.phpt b/ext/mbstring/tests/mb_substr_count_error1.phpt new file mode 100644 index 00000000000..8ddcaa6d635 --- /dev/null +++ b/ext/mbstring/tests/mb_substr_count_error1.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test mb_substr_count() function : error conditions - pass incorrect number of arguments +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr_count() : error conditions *** + +-- Testing mb_substr_count() function with more than expected no. of arguments -- + +Warning: mb_substr_count() expects at most 3 parameters, 4 given in %s on line %d +NULL + +-- Testing mb_substr_count() function with less than expected no. of arguments -- + +Warning: mb_substr_count() expects at least 2 parameters, 1 given in %s on line %d +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_substr_count_error2.phpt b/ext/mbstring/tests/mb_substr_count_error2.phpt new file mode 100644 index 00000000000..e2572b028e8 --- /dev/null +++ b/ext/mbstring/tests/mb_substr_count_error2.phpt @@ -0,0 +1,37 @@ +--TEST-- +Test mb_substr_count() function : error conditions - pass unknown encoding +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr_count() : error conditions *** + +-- Testing mb_substr_count() function with an unknown encoding -- + +Warning: mb_substr_count(): Unknown encoding "unknown-encoding" in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_substr_count_variation1.phpt b/ext/mbstring/tests/mb_substr_count_variation1.phpt new file mode 100644 index 00000000000..8121b487146 --- /dev/null +++ b/ext/mbstring/tests/mb_substr_count_variation1.phpt @@ -0,0 +1,183 @@ +--TEST-- +Test mb_substr_count() function : usage variations - Pass different data types as $haystack arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr_count() : usage variations *** + +-- Iteration 1 -- +int(0) + +-- Iteration 2 -- +int(0) + +-- Iteration 3 -- +int(0) + +-- Iteration 4 -- +int(0) + +-- Iteration 5 -- +int(0) + +-- Iteration 6 -- +int(0) + +-- Iteration 7 -- +int(0) + +-- Iteration 8 -- +int(0) + +-- Iteration 9 -- +int(0) + +-- Iteration 10 -- +int(0) + +-- Iteration 11 -- +int(0) + +-- Iteration 12 -- +int(0) + +-- Iteration 13 -- +int(0) + +-- Iteration 14 -- +int(0) + +-- Iteration 15 -- +int(0) + +-- Iteration 16 -- +int(0) + +-- Iteration 17 -- +int(0) + +-- Iteration 18 -- +int(1) + +-- Iteration 19 -- +int(1) + +-- Iteration 20 -- +int(1) + +-- Iteration 21 -- +int(1) + +-- Iteration 22 -- +int(0) + +-- Iteration 23 -- +int(0) + +-- Iteration 24 -- + +Warning: mb_substr_count() expects parameter 1 to be string, resource given in %s on line %d +NULL +Done diff --git a/ext/mbstring/tests/mb_substr_count_variation2.phpt b/ext/mbstring/tests/mb_substr_count_variation2.phpt new file mode 100644 index 00000000000..dac48b55a77 --- /dev/null +++ b/ext/mbstring/tests/mb_substr_count_variation2.phpt @@ -0,0 +1,197 @@ +--TEST-- +Test mb_substr_count() function : usage variations - pass different data types as $needle arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr_count() : usage variations *** + +-- Iteration 1 -- +int(0) + +-- Iteration 2 -- +int(0) + +-- Iteration 3 -- +int(0) + +-- Iteration 4 -- +int(0) + +-- Iteration 5 -- +int(0) + +-- Iteration 6 -- +int(0) + +-- Iteration 7 -- +int(0) + +-- Iteration 8 -- +int(0) + +-- Iteration 9 -- +int(0) + +-- Iteration 10 -- + +Warning: mb_substr_count(): Empty substring. in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: mb_substr_count(): Empty substring. in %s on line %d +bool(false) + +-- Iteration 12 -- +int(0) + +-- Iteration 13 -- + +Warning: mb_substr_count(): Empty substring. in %s on line %d +bool(false) + +-- Iteration 14 -- +int(0) + +-- Iteration 15 -- + +Warning: mb_substr_count(): Empty substring. in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: mb_substr_count(): Empty substring. in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: mb_substr_count(): Empty substring. in %s on line %d +bool(false) + +-- Iteration 18 -- +int(1) + +-- Iteration 19 -- +int(1) + +-- Iteration 20 -- +int(1) + +-- Iteration 21 -- +int(1) + +-- Iteration 22 -- + +Warning: mb_substr_count(): Empty substring. in %s on line %d +bool(false) + +-- Iteration 23 -- + +Warning: mb_substr_count(): Empty substring. in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: mb_substr_count() expects parameter 2 to be string, resource given in %s on line %d +NULL +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_substr_count_variation3.phpt b/ext/mbstring/tests/mb_substr_count_variation3.phpt new file mode 100644 index 00000000000..d2e7a605669 --- /dev/null +++ b/ext/mbstring/tests/mb_substr_count_variation3.phpt @@ -0,0 +1,220 @@ +--TEST-- +Test mb_substr_count() function :usage variations - pass different data types as $encoding arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr_count() : usage variations *** + +-- Iteration 1 -- + +Warning: mb_substr_count(): Unknown encoding "0" in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: mb_substr_count(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: mb_substr_count(): Unknown encoding "12345" in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: mb_substr_count(): Unknown encoding "-2345" in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: mb_substr_count(): Unknown encoding "10.5" in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: mb_substr_count(): Unknown encoding "-10.5" in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: mb_substr_count(): Unknown encoding "123456789000" in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: mb_substr_count(): Unknown encoding "1.23456789E-9" in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: mb_substr_count(): Unknown encoding "0.5" in %s on line %d +bool(false) + +-- Iteration 10 -- + +Warning: mb_substr_count(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: mb_substr_count(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 12 -- + +Warning: mb_substr_count(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: mb_substr_count(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 14 -- + +Warning: mb_substr_count(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: mb_substr_count(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: mb_substr_count(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: mb_substr_count(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 18 -- +int(1) + +-- Iteration 19 -- +int(1) + +-- Iteration 20 -- +int(1) + +-- Iteration 21 -- +int(1) + +-- Iteration 22 -- + +Warning: mb_substr_count(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 23 -- + +Warning: mb_substr_count(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: mb_substr_count() 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/mbstring/tests/mb_substr_error1.phpt b/ext/mbstring/tests/mb_substr_error1.phpt new file mode 100644 index 00000000000..c2007c93b60 --- /dev/null +++ b/ext/mbstring/tests/mb_substr_error1.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test mb_substr() function : error conditions - Pass incorrect number of args +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr() : error conditions *** + +-- Testing mb_substr() function with more than expected no. of arguments -- + +Warning: Wrong parameter count for mb_substr() in %s on line %d +NULL + +-- Testing mb_substr() function with less than expected no. of arguments -- + +Warning: Wrong parameter count for mb_substr() in %s on line %d +NULL +Done diff --git a/ext/mbstring/tests/mb_substr_error2.phpt b/ext/mbstring/tests/mb_substr_error2.phpt new file mode 100644 index 00000000000..72be974ed07 --- /dev/null +++ b/ext/mbstring/tests/mb_substr_error2.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test mb_substr() function : error conditions - Pass an unknown encoding +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr() : error conditions *** + +Warning: mb_substr(): Unknown encoding "unknown-encoding" in %s on line %d +bool(false) +Done diff --git a/ext/mbstring/tests/mb_substr_variation1.phpt b/ext/mbstring/tests/mb_substr_variation1.phpt new file mode 100644 index 00000000000..fd9d0db478e --- /dev/null +++ b/ext/mbstring/tests/mb_substr_variation1.phpt @@ -0,0 +1,179 @@ +--TEST-- +Test mb_substr() function : usage variations - pass unexpected arguments (including strings) in place of $str +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr() : usage variations *** + +-- Iteration 1 -- +string(1) "0" + +-- Iteration 2 -- +string(1) "1" + +-- Iteration 3 -- +string(5) "12345" + +-- Iteration 4 -- +string(5) "-2345" + +-- Iteration 5 -- +string(4) "10.5" + +-- Iteration 6 -- +string(5) "-10.5" + +-- Iteration 7 -- +string(5) "12345" + +-- Iteration 8 -- +string(5) "1.234" + +-- Iteration 9 -- +string(3) "0.5" + +-- Iteration 10 -- +string(0) "" + +-- Iteration 11 -- +string(0) "" + +-- Iteration 12 -- +string(1) "1" + +-- Iteration 13 -- +string(0) "" + +-- Iteration 14 -- +string(1) "1" + +-- Iteration 15 -- +string(0) "" + +-- Iteration 16 -- +string(0) "" + +-- Iteration 17 -- +string(0) "" + +-- Iteration 18 -- +string(5) "strin" + +-- Iteration 19 -- +string(5) "strin" + +-- Iteration 20 -- +string(5) "hello" + +-- Iteration 21 -- +string(5) "Class" + +-- Iteration 22 -- +string(0) "" + +-- Iteration 23 -- +string(0) "" + +-- Iteration 24 -- +string(5) "Resou" +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_substr_variation2.phpt b/ext/mbstring/tests/mb_substr_variation2.phpt new file mode 100644 index 00000000000..cb8a37af5ce --- /dev/null +++ b/ext/mbstring/tests/mb_substr_variation2.phpt @@ -0,0 +1,220 @@ +--TEST-- +Test mb_substr() function : usage variations - Pass different data types as $encoding arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr() : usage variations *** + +-- Iteration 1 -- + +Warning: mb_substr(): Unknown encoding "0" in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: mb_substr(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: mb_substr(): Unknown encoding "12345" in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: mb_substr(): Unknown encoding "-2345" in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: mb_substr(): Unknown encoding "10.5" in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: mb_substr(): Unknown encoding "-10.5" in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: mb_substr(): Unknown encoding "123456789000" in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: mb_substr(): Unknown encoding "1.23456789E-9" in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: mb_substr(): Unknown encoding "0.5" in %s on line %d +bool(false) + +-- Iteration 10 -- + +Warning: mb_substr(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: mb_substr(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 12 -- + +Warning: mb_substr(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: mb_substr(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 14 -- + +Warning: mb_substr(): Unknown encoding "1" in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: mb_substr(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: mb_substr(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: mb_substr(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 18 -- +string(5) "tring" + +-- Iteration 19 -- +string(5) "tring" + +-- Iteration 20 -- +string(5) "tring" + +-- Iteration 21 -- +string(5) "tring" + +-- Iteration 22 -- + +Warning: mb_substr(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 23 -- + +Warning: mb_substr(): Unknown encoding "" in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: mb_substr(): Unknown encoding "Resource id #%d" in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_substr_variation3.phpt b/ext/mbstring/tests/mb_substr_variation3.phpt new file mode 100644 index 00000000000..bb930b4b9aa --- /dev/null +++ b/ext/mbstring/tests/mb_substr_variation3.phpt @@ -0,0 +1,445 @@ +--TEST-- +Test mb_substr() function : usage variations - test different encodings +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr() : usage variations *** + +-- Iteration 1: UCS-4 -- +-- ASCII String -- +Encoding UCS-4 recognised +-- Multibyte String -- +Encoding UCS-4 recognised + +-- Iteration 1: UCS-4BE -- +-- ASCII String -- +Encoding UCS-4BE recognised +-- Multibyte String -- +Encoding UCS-4BE recognised + +-- Iteration 1: UCS-4LE -- +-- ASCII String -- +Encoding UCS-4LE recognised +-- Multibyte String -- +Encoding UCS-4LE recognised + +-- Iteration 1: UCS-2 -- +-- ASCII String -- +Encoding UCS-2 recognised +-- Multibyte String -- +Encoding UCS-2 recognised + +-- Iteration 1: UCS-2BE -- +-- ASCII String -- +Encoding UCS-2BE recognised +-- Multibyte String -- +Encoding UCS-2BE recognised + +-- Iteration 1: UCS-2LE -- +-- ASCII String -- +Encoding UCS-2LE recognised +-- Multibyte String -- +Encoding UCS-2LE recognised + +-- Iteration 1: UTF-32 -- +-- ASCII String -- +Encoding UTF-32 recognised +-- Multibyte String -- +Encoding UTF-32 recognised + +-- Iteration 1: UTF-32BE -- +-- ASCII String -- +Encoding UTF-32BE recognised +-- Multibyte String -- +Encoding UTF-32BE recognised + +-- Iteration 1: UTF-32LE -- +-- ASCII String -- +Encoding UTF-32LE recognised +-- Multibyte String -- +Encoding UTF-32LE recognised + +-- Iteration 1: UTF-16 -- +-- ASCII String -- +Encoding UTF-16 recognised +-- Multibyte String -- +Encoding UTF-16 recognised + +-- Iteration 1: UTF-16BE -- +-- ASCII String -- +Encoding UTF-16BE recognised +-- Multibyte String -- +Encoding UTF-16BE recognised + +-- Iteration 1: UTF-16LE -- +-- ASCII String -- +Encoding UTF-16LE recognised +-- Multibyte String -- +Encoding UTF-16LE recognised + +-- Iteration 1: UTF-7 -- +-- ASCII String -- +Encoding UTF-7 recognised +-- Multibyte String -- +Encoding UTF-7 recognised + +-- Iteration 1: UTF7-IMAP -- +-- ASCII String -- +Encoding UTF7-IMAP recognised +-- Multibyte String -- +Encoding UTF7-IMAP recognised + +-- Iteration 1: UTF-8 -- +-- ASCII String -- +Encoding UTF-8 recognised +-- Multibyte String -- +Encoding UTF-8 recognised + +-- Iteration 1: ASCII -- +-- ASCII String -- +Encoding ASCII recognised +-- Multibyte String -- +Encoding ASCII recognised + +-- Iteration 1: EUC-JP -- +-- ASCII String -- +Encoding EUC-JP recognised +-- Multibyte String -- +Encoding EUC-JP recognised + +-- Iteration 1: SJIS -- +-- ASCII String -- +Encoding SJIS recognised +-- Multibyte String -- +Encoding SJIS recognised + +-- Iteration 1: eucJP-win -- +-- ASCII String -- +Encoding eucJP-win recognised +-- Multibyte String -- +Encoding eucJP-win recognised + +-- Iteration 1: SJIS-win -- +-- ASCII String -- +Encoding SJIS-win recognised +-- Multibyte String -- +Encoding SJIS-win recognised + +-- Iteration 1: ISO-2022-JP -- +-- ASCII String -- +Encoding ISO-2022-JP recognised +-- Multibyte String -- +Encoding ISO-2022-JP recognised + +-- Iteration 1: JIS -- +-- ASCII String -- +Encoding JIS recognised +-- Multibyte String -- +Encoding JIS recognised + +-- Iteration 1: ISO-8859-1 -- +-- ASCII String -- +Encoding ISO-8859-1 recognised +-- Multibyte String -- +Encoding ISO-8859-1 recognised + +-- Iteration 1: ISO-8859-2 -- +-- ASCII String -- +Encoding ISO-8859-2 recognised +-- Multibyte String -- +Encoding ISO-8859-2 recognised + +-- Iteration 1: ISO-8859-3 -- +-- ASCII String -- +Encoding ISO-8859-3 recognised +-- Multibyte String -- +Encoding ISO-8859-3 recognised + +-- Iteration 1: ISO-8859-4 -- +-- ASCII String -- +Encoding ISO-8859-4 recognised +-- Multibyte String -- +Encoding ISO-8859-4 recognised + +-- Iteration 1: ISO-8859-5 -- +-- ASCII String -- +Encoding ISO-8859-5 recognised +-- Multibyte String -- +Encoding ISO-8859-5 recognised + +-- Iteration 1: ISO-8859-6 -- +-- ASCII String -- +Encoding ISO-8859-6 recognised +-- Multibyte String -- +Encoding ISO-8859-6 recognised + +-- Iteration 1: ISO-8859-7 -- +-- ASCII String -- +Encoding ISO-8859-7 recognised +-- Multibyte String -- +Encoding ISO-8859-7 recognised + +-- Iteration 1: ISO-8859-8 -- +-- ASCII String -- +Encoding ISO-8859-8 recognised +-- Multibyte String -- +Encoding ISO-8859-8 recognised + +-- Iteration 1: ISO-8859-9 -- +-- ASCII String -- +Encoding ISO-8859-9 recognised +-- Multibyte String -- +Encoding ISO-8859-9 recognised + +-- Iteration 1: ISO-8859-10 -- +-- ASCII String -- +Encoding ISO-8859-10 recognised +-- Multibyte String -- +Encoding ISO-8859-10 recognised + +-- Iteration 1: ISO-8859-13 -- +-- ASCII String -- +Encoding ISO-8859-13 recognised +-- Multibyte String -- +Encoding ISO-8859-13 recognised + +-- Iteration 1: ISO-8859-14 -- +-- ASCII String -- +Encoding ISO-8859-14 recognised +-- Multibyte String -- +Encoding ISO-8859-14 recognised + +-- Iteration 1: ISO-8859-15 -- +-- ASCII String -- +Encoding ISO-8859-15 recognised +-- Multibyte String -- +Encoding ISO-8859-15 recognised + +-- Iteration 1: byte2be -- +-- ASCII String -- +Encoding byte2be recognised +-- Multibyte String -- +Encoding byte2be recognised + +-- Iteration 1: byte2le -- +-- ASCII String -- +Encoding byte2le recognised +-- Multibyte String -- +Encoding byte2le recognised + +-- Iteration 1: byte4be -- +-- ASCII String -- +Encoding byte4be recognised +-- Multibyte String -- +Encoding byte4be recognised + +-- Iteration 1: byte4le -- +-- ASCII String -- +Encoding byte4le recognised +-- Multibyte String -- +Encoding byte4le recognised + +-- Iteration 1: BASE64 -- +-- ASCII String -- +Encoding BASE64 recognised +-- Multibyte String -- +Encoding BASE64 recognised + +-- Iteration 1: HTML-ENTITIES -- +-- ASCII String -- +Encoding HTML-ENTITIES recognised +-- Multibyte String -- +Encoding HTML-ENTITIES recognised + +-- Iteration 1: 7bit -- +-- ASCII String -- +Encoding 7bit recognised +-- Multibyte String -- +Encoding 7bit recognised + +-- Iteration 1: 8bit -- +-- ASCII String -- +Encoding 8bit recognised +-- Multibyte String -- +Encoding 8bit recognised + +-- Iteration 1: EUC-CN -- +-- ASCII String -- +Encoding EUC-CN recognised +-- Multibyte String -- +Encoding EUC-CN recognised + +-- Iteration 1: CP936 -- +-- ASCII String -- +Encoding CP936 recognised +-- Multibyte String -- +Encoding CP936 recognised + +-- Iteration 1: HZ -- +-- ASCII String -- +Encoding HZ recognised +-- Multibyte String -- +Encoding HZ recognised + +-- Iteration 1: EUC-TW -- +-- ASCII String -- +Encoding EUC-TW recognised +-- Multibyte String -- +Encoding EUC-TW recognised + +-- Iteration 1: CP950 -- +-- ASCII String -- +Encoding CP950 recognised +-- Multibyte String -- +Encoding CP950 recognised + +-- Iteration 1: BIG-5 -- +-- ASCII String -- +Encoding BIG-5 recognised +-- Multibyte String -- +Encoding BIG-5 recognised + +-- Iteration 1: EUC-KR -- +-- ASCII String -- +Encoding EUC-KR recognised +-- Multibyte String -- +Encoding EUC-KR recognised + +-- Iteration 1: UHC -- +-- ASCII String -- +Encoding UHC recognised +-- Multibyte String -- +Encoding UHC recognised + +-- Iteration 1: ISO-2022-KR -- +-- ASCII String -- +Encoding ISO-2022-KR recognised +-- Multibyte String -- +Encoding ISO-2022-KR recognised + +-- Iteration 1: Windows-1251 -- +-- ASCII String -- +Encoding Windows-1251 recognised +-- Multibyte String -- +Encoding Windows-1251 recognised + +-- Iteration 1: Windows-1252 -- +-- ASCII String -- +Encoding Windows-1252 recognised +-- Multibyte String -- +Encoding Windows-1252 recognised + +-- Iteration 1: CP866 -- +-- ASCII String -- +Encoding CP866 recognised +-- Multibyte String -- +Encoding CP866 recognised + +-- Iteration 1: KOI8-R -- +-- ASCII String -- +Encoding KOI8-R recognised +-- Multibyte String -- +Encoding KOI8-R recognised +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_substr_variation4.phpt b/ext/mbstring/tests/mb_substr_variation4.phpt new file mode 100644 index 00000000000..d2c4de3ce8d --- /dev/null +++ b/ext/mbstring/tests/mb_substr_variation4.phpt @@ -0,0 +1,131 @@ +--TEST-- +Test mb_substr() function : usage variations - pass different integers to $start arg +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_substr() : usage variations *** + +**-- Offset is: -60 --** +-- ASCII String -- +string(4) "+Is " +--Multibyte String -- +string(16) "5pel5pys6Kqe44OG" + +**-- Offset is: -50 --** +-- ASCII String -- +string(4) "+Is " +--Multibyte String -- +string(16) "5pel5pys6Kqe44OG" + +**-- Offset is: -40 --** +-- ASCII String -- +string(4) "+Is " +--Multibyte String -- +string(16) "5pel5pys6Kqe44OG" + +**-- Offset is: -30 --** +-- ASCII String -- +string(4) "+Is " +--Multibyte String -- +string(16) "5pel5pys6Kqe44OG" + +**-- Offset is: -20 --** +-- ASCII String -- +string(4) "Is a" +--Multibyte String -- +string(16) "5pys6Kqe44OG44Kt" + +**-- Offset is: -10 --** +-- ASCII String -- +string(4) "ish " +--Multibyte String -- +string(8) "MTIzNA==" + +**-- Offset is: 0 --** +-- ASCII String -- +string(4) "+Is " +--Multibyte String -- +string(16) "5pel5pys6Kqe44OG" + +**-- Offset is: 10 --** +-- ASCII String -- +string(4) "lish" +--Multibyte String -- +string(8) "MDEyMw==" + +**-- Offset is: 20 --** +-- ASCII String -- +string(1) "g" +--Multibyte String -- +string(4) "44CC" + +**-- Offset is: 30 --** +-- ASCII String -- +string(0) "" +--Multibyte String -- +string(0) "" + +**-- Offset is: 40 --** +-- ASCII String -- +string(0) "" +--Multibyte String -- +string(0) "" + +**-- Offset is: 50 --** +-- ASCII String -- +string(0) "" +--Multibyte String -- +string(0) "" + +**-- Offset is: 60 --** +-- ASCII String -- +string(0) "" +--Multibyte String -- +string(0) "" +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_substr_variation5.phpt b/ext/mbstring/tests/mb_substr_variation5.phpt new file mode 100644 index 00000000000..02ea6d3aa8b --- /dev/null +++ b/ext/mbstring/tests/mb_substr_variation5.phpt @@ -0,0 +1,134 @@ +--TEST-- +Test mb_substr() function : usage variations - pass different integers to $length arg +--SKIPIF-- + +--FILE-- + + + +--EXPECTF-- +*** Testing mb_substr() : usage variations *** + +**-- Offset is: -60 --** +-- ASCII String -- +string(0) "" +--Multibyte String -- +string(0) "" + +**-- Offset is: -50 --** +-- ASCII String -- +string(0) "" +--Multibyte String -- +string(0) "" + +**-- Offset is: -40 --** +-- ASCII String -- +string(0) "" +--Multibyte String -- +string(0) "" + +**-- Offset is: -30 --** +-- ASCII String -- +string(0) "" +--Multibyte String -- +string(0) "" + +**-- Offset is: -20 --** +-- ASCII String -- +string(0) "" +--Multibyte String -- +string(0) "" + +**-- Offset is: -10 --** +-- ASCII String -- +string(10) "Is an Engl" +--Multibyte String -- +string(40) "5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMA==" + +**-- Offset is: 0 --** +-- ASCII String -- +string(0) "" +--Multibyte String -- +string(0) "" + +**-- Offset is: 10 --** +-- ASCII String -- +string(10) "Is an Engl" +--Multibyte String -- +string(40) "5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMA==" + +**-- Offset is: 20 --** +-- ASCII String -- +string(20) "Is an English string" +--Multibyte String -- +string(68) "5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" + +**-- Offset is: 30 --** +-- ASCII String -- +string(20) "Is an English string" +--Multibyte String -- +string(68) "5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" + +**-- Offset is: 40 --** +-- ASCII String -- +string(20) "Is an English string" +--Multibyte String -- +string(68) "5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" + +**-- Offset is: 50 --** +-- ASCII String -- +string(20) "Is an English string" +--Multibyte String -- +string(68) "5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" + +**-- Offset is: 60 --** +-- ASCII String -- +string(20) "Is an English string" +--Multibyte String -- +string(68) "5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" +Done \ No newline at end of file