Annotation of embedaddon/php/ext/mbstring/tests/mb_substitute_character.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: mb_substitute_character()
! 3: --SKIPIF--
! 4: <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
! 5: --FILE--
! 6: <?php
! 7: //$debug = true;
! 8: ini_set('include_path', dirname(__FILE__));
! 9: include_once('common.inc');
! 10:
! 11: // Note: It does not return TRUE/FALSE for setting char
! 12:
! 13: var_dump(mb_substitute_character(0x3044));
! 14: var_dump(mb_substitute_character());
! 15: var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8")));
! 16:
! 17: var_dump(mb_substitute_character('long'));
! 18: var_dump(mb_substitute_character());
! 19: var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8")));
! 20:
! 21: var_dump(mb_substitute_character('none'));
! 22: var_dump(mb_substitute_character());
! 23: var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8")));
! 24:
! 25: var_dump(mb_substitute_character('entity'));
! 26: var_dump(mb_substitute_character());
! 27: var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8")));
! 28:
! 29: var_dump(mb_substitute_character('BAD_NAME'));
! 30: ?>
! 31: --EXPECT--
! 32: bool(true)
! 33: int(12356)
! 34: string(8) "82a282a0"
! 35: bool(true)
! 36: string(4) "long"
! 37: string(16) "552b3236363082a0"
! 38: bool(true)
! 39: string(4) "none"
! 40: string(4) "82a0"
! 41: bool(true)
! 42: string(6) "entity"
! 43: string(20) "262378323636303b82a0"
! 44: ERR: Warning
! 45: bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>