Annotation of embedaddon/php/ext/mbstring/tests/bug43998.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test mb_strtolower() function : Two error messages returned for incorrect encoding for mb_strto[upper|lower]
! 3: --SKIPIF--
! 4: <?php
! 5: extension_loaded('mbstring') or die('skip');
! 6: function_exists('mb_strtolower') or die("skip mb_strtolower() is not available in this build");
! 7: ?>
! 8: --FILE--
! 9: <?php
! 10: /* Prototype : string mb_strto[lower|upper](string $sourcestring [, string $encoding])
! 11: * Description: Returns a [lower|upper]cased version of $sourcestring
! 12: * Source code: ext/mbstring/mbstring.c
! 13: */
! 14:
! 15: /*
! 16: * Two error messages returned for incorrect encoding for mb_strto[upper|lower]
! 17: * Bug now appears to be fixed
! 18: */
! 19:
! 20: $sourcestring = 'Hello, World';
! 21:
! 22: $inputs = array(12345, 12.3456789000E-10, true, false, "");
! 23: $iterator = 1;
! 24: foreach($inputs as $input) {
! 25: echo "\n-- Iteration $iterator --\n";
! 26: var_dump( mb_strtolower($sourcestring, $input) );
! 27: var_dump( mb_strtoupper($sourcestring, $input) );
! 28: $iterator++;
! 29: };
! 30: ?>
! 31: --EXPECTF--
! 32:
! 33: -- Iteration 1 --
! 34:
! 35: Warning: mb_strtolower(): Unknown encoding "12345" in %s on line %d
! 36: bool(false)
! 37:
! 38: Warning: mb_strtoupper(): Unknown encoding "12345" in %s on line %d
! 39: bool(false)
! 40:
! 41: -- Iteration 2 --
! 42:
! 43: Warning: mb_strtolower(): Unknown encoding "1.23456789E-9" in %s on line %d
! 44: bool(false)
! 45:
! 46: Warning: mb_strtoupper(): Unknown encoding "1.23456789E-9" in %s on line %d
! 47: bool(false)
! 48:
! 49: -- Iteration 3 --
! 50:
! 51: Warning: mb_strtolower(): Unknown encoding "1" in %s on line %d
! 52: bool(false)
! 53:
! 54: Warning: mb_strtoupper(): Unknown encoding "1" in %s on line %d
! 55: bool(false)
! 56:
! 57: -- Iteration 4 --
! 58:
! 59: Warning: mb_strtolower(): Unknown encoding "" in %s on line %d
! 60: bool(false)
! 61:
! 62: Warning: mb_strtoupper(): Unknown encoding "" in %s on line %d
! 63: bool(false)
! 64:
! 65: -- Iteration 5 --
! 66:
! 67: Warning: mb_strtolower(): Unknown encoding "" in %s on line %d
! 68: bool(false)
! 69:
! 70: Warning: mb_strtoupper(): Unknown encoding "" in %s on line %d
! 71: bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>