diff options
Diffstat (limited to 'ext/mbstring/tests/mb_http_output.phpt')
-rw-r--r-- | ext/mbstring/tests/mb_http_output.phpt | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/ext/mbstring/tests/mb_http_output.phpt b/ext/mbstring/tests/mb_http_output.phpt index b62734f02d..2df6eca8a0 100644 --- a/ext/mbstring/tests/mb_http_output.phpt +++ b/ext/mbstring/tests/mb_http_output.phpt @@ -41,24 +41,18 @@ print "$enc\n"; // Invalid parameters print "== INVALID PARAMETER ==\n"; -// Note: Bad string raise Warning. Bad Type raise Notice (Type Conversion) and Warning.... -$r = mb_http_output('BAD_NAME'); -($r === FALSE) ? print "OK_BAD_SET\n" : print "NG_BAD_SET\n"; -$enc = mb_http_output(); -print "$enc\n"; - -$r = mb_http_output($t_ary); -($r === NULL) ? print "OK_BAD_ARY_SET\n" : print "NG_BAD_ARY_SET\n"; -$enc = mb_http_output(); -print "$enc\n"; - -$r = mb_http_output($t_obj); -($r === NULL) ? print "OK_BAD_OBJ_SET\n" : print "NG_BAD_OBJ_SET\n"; +// Note: Bad string raise ValueError. Bad Type raise Notice (Type Conversion) and ValueError +try { + $r = mb_http_output('BAD_NAME'); + print 'NG_BAD_SET' . \PHP_EOL; +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} $enc = mb_http_output(); print "$enc\n"; ?> ---EXPECTF-- +--EXPECT-- OK_ASCII_SET ASCII OK_SJIS_SET @@ -70,15 +64,5 @@ UTF-8 OK_EUC-JP_SET EUC-JP == INVALID PARAMETER == - -Warning: mb_http_output(): Unknown encoding "BAD_NAME" in %s on line %d -OK_BAD_SET -EUC-JP - -Warning: mb_http_output() expects parameter 1 to be string, array given in %s on line %d -OK_BAD_ARY_SET -EUC-JP - -Warning: mb_http_output() expects parameter 1 to be string, object given in %s on line %d -OK_BAD_OBJ_SET +mb_http_output(): Argument #1 ($encoding) must be a valid encoding, "BAD_NAME" given EUC-JP |