From 642b84cd83cc913391e2eb24cd48d064def7d1b7 Mon Sep 17 00:00:00 2001 From: andy wharmby Date: Sat, 13 Jun 2009 12:17:42 +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 | 50 +++++++++++++++++++++ ext/iconv/tests/iconv_substr_error2.phpt | 36 ++++++++++++++++ 3 files changed, 141 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..b8db8a124f --- /dev/null +++ b/ext/iconv/tests/iconv_substr_basic.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test iconv_substr() function : basic functionality +--SKIPIF-- + +--FILE-- + +--EXPECT-- +*** Testing iconv_substr() : basic functionality *** + +-- ASCII string 1 -- +string(6) "444546" + +-- ASCII string 2 -- +string(6) "444546" + +-- Multibyte string 1 -- +string(14) "a5e69cace8aa9e" + +-- Multibyte string 2 -- +string(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..7a30c7d509 --- /dev/null +++ b/ext/iconv/tests/iconv_substr_error1.phpt @@ -0,0 +1,50 @@ +--TEST-- +Test iconv_substr() function : error conditions - Pass incorrect number of args +--SKIPIF-- + +--FILE-- + +--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..ac5081331b --- /dev/null +++ b/ext/iconv/tests/iconv_substr_error2.phpt @@ -0,0 +1,36 @@ +--TEST-- +Test iconv_substr() function : error conditions - Pass an unknown encoding +--SKIPIF-- + +--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.0