diff --git a/ext/iconv/tests/iconv_substr_basic.phpt b/ext/iconv/tests/iconv_substr_basic.phpt new file mode 100644 index 00000000000..2fd06bd0d0b --- /dev/null +++ b/ext/iconv/tests/iconv_substr_basic.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test iconv_substr() function : basic functionality +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing iconv_substr() : basic functionality *** + +-- ASCII string 1 -- +unicode(6) "444546" + +-- ASCII string 2 -- +unicode(6) "444546" + +-- Multibyte string 1 -- +unicode(14) "a5e69cace8aa9e" + +-- Multibyte string 2 -- +unicode(42) "e8aa9ee38386e382ade382b9e38388e381a7e38199" +===DONE=== \ No newline at end of file diff --git a/ext/iconv/tests/iconv_substr_error1.phpt b/ext/iconv/tests/iconv_substr_error1.phpt new file mode 100644 index 00000000000..c786b11ef2e --- /dev/null +++ b/ext/iconv/tests/iconv_substr_error1.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test iconv_substr() function : error conditions - Pass incorrect number of args +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing iconv_substr() : error conditions *** + +-- Testing iconv_substr() function with more than expected no. of arguments -- + +Warning: iconv_substr() expects at most 4 parameters, 5 given in %s on line %d +bool(false) + +-- Testing iconv_substr() function with less than expected no. of arguments -- + +Warning: iconv_substr() expects at least 2 parameters, 1 given in %s on line %d +bool(false) +===DONE=== diff --git a/ext/iconv/tests/iconv_substr_error2.phpt b/ext/iconv/tests/iconv_substr_error2.phpt new file mode 100644 index 00000000000..60a11cc2fdb --- /dev/null +++ b/ext/iconv/tests/iconv_substr_error2.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test iconv_substr() function : error conditions - Pass an unknown encoding +--SKIPIF-- + +--XFAIL-- +Will fail until bug #48538 fixed +--FILE-- + +--EXPECTF-- +*** Testing iconv_substr() : error conditions *** + +Notice: iconv_substr(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d +bool(false) +Done +