xref: /PHP-5.4/ext/intl/tests/bug53512.phpt (revision 8b1d4770)
1--TEST--
2Bug #53512 (NumberFormatter::setSymbol crash on bogus $attr values)
3--SKIPIF--
4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5--FILE--
6<?php
7
8$badvals = array(4294901761, 2147483648, -2147483648, -1);
9
10foreach ($badvals as $val) {
11	$x = numfmt_create("en", NumberFormatter::PATTERN_DECIMAL);
12	var_dump(numfmt_set_symbol($x, $val, ""));
13	var_dump(intl_get_error_message());
14}
15
16?>
17--EXPECTF--
18bool(false)
19string(65) "numfmt_set_symbol: invalid symbol value: U_ILLEGAL_ARGUMENT_ERROR"
20bool(false)
21string(65) "numfmt_set_symbol: invalid symbol value: U_ILLEGAL_ARGUMENT_ERROR"
22bool(false)
23string(65) "numfmt_set_symbol: invalid symbol value: U_ILLEGAL_ARGUMENT_ERROR"
24bool(false)
25string(65) "numfmt_set_symbol: invalid symbol value: U_ILLEGAL_ARGUMENT_ERROR"
26