Annotation of embedaddon/php/ext/iconv/tests/iconv_strlen_error2.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Test iconv_strlen() function : error conditions - pass an unknown encoding
        !             3: --SKIPIF--
        !             4: <?php
        !             5: extension_loaded('iconv') or die('skip');
        !             6: function_exists('iconv_strlen') or die("skip iconv_strlen() is not available in this build");
        !             7: ?>
        !             8: --FILE--
        !             9: <?php
        !            10: /* Prototype  : int iconv_strlen(string str [, string charset])
        !            11:  * Description: Get character numbers of a string 
        !            12:  * Source code: ext/iconv/iconv.c
        !            13:  */
        !            14: 
        !            15: /*
        !            16:  * Test iconv_strlen when passed an unknown encoding
        !            17:  */
        !            18: 
        !            19: echo "*** Testing iconv_strlen() : error ***\n";
        !            20: 
        !            21: $string = 'abcdef';
        !            22: 
        !            23: $encoding = 'unknown-encoding';
        !            24: 
        !            25: var_dump(iconv_strlen($string, $encoding));
        !            26: 
        !            27: ?>
        !            28: ===DONE===
        !            29: --EXPECTF--
        !            30: *** Testing iconv_strlen() : error ***
        !            31: 
        !            32: Notice: iconv_strlen(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d
        !            33: bool(false)
        !            34: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>