PHP  
 PHP_7_2
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/intl/tests/msgfmt_fail.phpt ('msgfmt creation failures icu <= 4.2')

Script

1: <?php
2:
3:
function err($fmt) {
4:     if(!
$fmt) {
5:         echo 
var_export(intl_get_error_message(), true)."\n";
6:     }
7: }
8:
9: function 
print_exception($e) {
10:     echo 
"\n" get_class($e) . ": " $e->getMessage()
11:        . 
" in " $e->getFile() . " on line " $e->getLine() . "\n";
12: }
13:
14: function 
crt($t$l$s) {
15:     switch(
true) {
16:         case 
$t == "O":
17:             try {
18:                 return new 
MessageFormatter($l$s);
19:             } catch (
Throwable $e) {
20:                 
print_exception($e);
21:                 return 
null;
22:             }
23:             break;
24:         case 
$t == "C":
25:             return 
MessageFormatter::create($l$s);
26:             break;
27:         case 
$t == "P":
28:             return 
msgfmt_create($l$s);
29:             break;
30:     }
31: }
32:
33:
$args = array(
34:     array(
nullnull),
35:     array(
"whatever""{0,whatever}"),
36:     array(array(), array()),
37:     array(
"en""{0,choice}"),
38:     array(
"fr""{0,"),
39:     array(
"en_US""\xD0"),
40: );
41:
42: try {
43:     
$fmt = new MessageFormatter();
44: } catch (
TypeError $e) {
45:     
print_exception($e);
46:     
$fmt null;
47: }
48:
err($fmt); 
49:
$fmt msgfmt_create();
50:
err($fmt); 
51:
$fmt MessageFormatter::create();
52:
err($fmt);
53: try {
54:     
$fmt = new MessageFormatter('en');
55: } catch (
TypeError $e) {
56:     
print_exception($e);
57:     
$fmt null;
58: }
59:
err($fmt); 
60:
$fmt msgfmt_create('en');
61:
err($fmt); 
62:
$fmt MessageFormatter::create('en');
63:
err($fmt); 
64:
65: foreach(
$args as $arg) {
66:     
$fmt crt("O"$arg[0], $arg[1]);
67:     
err($fmt);
68:     
$fmt crt("C"$arg[0], $arg[1]);
69:     
err($fmt);
70:     
$fmt crt("P"$arg[0], $arg[1]);
71:     
err($fmt);
72: }
73:
74:
?>
75:

Expected

TypeError: MessageFormatter::__construct() expects exactly 2 parameters, 0 given in %s on line %d
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

Warning: msgfmt_create() expects exactly 2 parameters, 0 given in %s on line %d
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

Warning: MessageFormatter::create() expects exactly 2 parameters, 0 given in %s on line %d
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

TypeError: MessageFormatter::__construct() expects exactly 2 parameters, 1 given in %s on line %d
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

Warning: msgfmt_create() expects exactly 2 parameters, 1 given in %s on line %d
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

Warning: MessageFormatter::create() expects exactly 2 parameters, 1 given in %s on line %d
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'

IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'

TypeError: MessageFormatter::__construct() expects parameter 1 to be string, array given in %s on line %d
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

Warning: MessageFormatter::create() expects parameter 1 to be string, array given in %s on line %d
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

Warning: msgfmt_create() expects parameter 1 to be string, array given in %s on line %d
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'

IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
'msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES'
'msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES'
'msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES'

IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
'msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND'
'msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND'
'msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND'

Output

ArgumentCountError: MessageFormatter::__construct() expects exactly 2 parameters, 0 given in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 43
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

Warning: msgfmt_create() expects exactly 2 parameters, 0 given in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 49
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

Warning: MessageFormatter::create() expects exactly 2 parameters, 0 given in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 51
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

ArgumentCountError: MessageFormatter::__construct() expects exactly 2 parameters, 1 given in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 54
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

Warning: msgfmt_create() expects exactly 2 parameters, 1 given in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 60
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

Warning: MessageFormatter::create() expects exactly 2 parameters, 1 given in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 62
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

IntlException: Constructor failed in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 18
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'

IntlException: Constructor failed in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 18
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'

TypeError: MessageFormatter::__construct() expects parameter 1 to be string, array given in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 18
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

Warning: MessageFormatter::create() expects parameter 1 to be string, array given in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 25
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

Warning: msgfmt_create() expects parameter 1 to be string, array given in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 28
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'

IntlException: Constructor failed in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 18
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'

IntlException: Constructor failed in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 18
'msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES'
'msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES'
'msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES'

IntlException: Constructor failed in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 18
'msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND'
'msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND'
'msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND'

Diff

001+ ArgumentCountError: MessageFormatter::__construct() expects exactly 2 parameters, 0 given in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 43
001- TypeError: MessageFormatter::__construct() expects exactly 2 parameters, 0 given in %s on line %d
010+ ArgumentCountError: MessageFormatter::__construct() expects exactly 2 parameters, 1 given in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 54
010- TypeError: MessageFormatter::__construct() expects exactly 2 parameters, 1 given in %s on line %d
019+ IntlException: Constructor failed in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 18
019- IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
024+ IntlException: Constructor failed in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 18
024- IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
038+ IntlException: Constructor failed in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 18
038- IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
043+ IntlException: Constructor failed in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 18
043- IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
048+ IntlException: Constructor failed in /var/php_gcov/PHP_7_2/ext/intl/tests/msgfmt_fail.php on line 18
048- IntlException: Constructor failed in %smsgfmt_fail2.php on line %d

 

Generated at Sat, 16 Sep 2017 05:04:10 +0000 (5 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.