From 0e8ecad7f3efb2cc49e35783ff6b5ca7df87e7e6 Mon Sep 17 00:00:00 2001 From: andy wharmby Date: Sat, 13 Jun 2009 12:17:47 +0000 Subject: [PATCH] New iconv extension tests. Tested on Windows, Linux and Linux 64 bit. --- ext/iconv/tests/iconv_substr_basic.phpt | 55 ++++++++++++++++++++++++ ext/iconv/tests/iconv_substr_error1.phpt | 49 +++++++++++++++++++++ ext/iconv/tests/iconv_substr_error2.phpt | 38 ++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 ext/iconv/tests/iconv_substr_basic.phpt create mode 100644 ext/iconv/tests/iconv_substr_error1.phpt create mode 100644 ext/iconv/tests/iconv_substr_error2.phpt diff --git a/ext/iconv/tests/iconv_substr_basic.phpt b/ext/iconv/tests/iconv_substr_basic.phpt new file mode 100644 index 0000000000..2fd06bd0d0 --- /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 0000000000..c786b11ef2 --- /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 0000000000..60a11cc2fd --- /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 + -- 2.50.1