1--TEST--
2Transliterator::createFromRules (error)
3--SKIPIF--
4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5--FILE--
6<?php
7ini_set("intl.error_level", E_WARNING);
8
9$t = Transliterator::createFromRules();
10echo intl_get_error_message(),"\n";
11
12$t = Transliterator::createFromRules("a","b");
13echo intl_get_error_message(),"\n";
14
15$t = Transliterator::createFromRules("\x8Fss");
16echo intl_get_error_message(),"\n";
17
18$rules = <<<RULES
19\`\` } a > “;
20\`\` } a > b;
21RULES;
22
23$t = Transliterator::createFromRules($rules);
24echo intl_get_error_message(),"\n";
25
26$rules = <<<RULES
27ffff
28RULES;
29
30$t = Transliterator::createFromRules($rules);
31echo intl_get_error_message(),"\n";
32echo "Done.\n";
33
34--EXPECTF--
35Warning: Transliterator::createFromRules() expects at least 1 parameter, 0 given in %s on line %d
36
37Warning: Transliterator::createFromRules(): transliterator_create_from_rules: bad arguments in %s on line %d
38transliterator_create_from_rules: bad arguments: U_ILLEGAL_ARGUMENT_ERROR
39
40Warning: Transliterator::createFromRules() expects parameter 2 to be integer, string given in %s on line %d
41
42Warning: Transliterator::createFromRules(): transliterator_create_from_rules: bad arguments in %s on line %d
43transliterator_create_from_rules: bad arguments: U_ILLEGAL_ARGUMENT_ERROR
44
45Warning: Transliterator::createFromRules(): String conversion of rules to UTF-16 failed in %s on line %d
46String conversion of rules to UTF-16 failed: U_INVALID_CHAR_FOUND
47
48Warning: Transliterator::createFromRules(): transliterator_create_from_rules: unable to create ICU transliterator from rules (parse error after "{'``'}a > “;", before or at "{'``'}a > b;") in %s on line %d
49transliterator_create_from_rules: unable to create ICU transliterator from rules (parse error after "{'``'}a > “;", before or at "{'``'}a > b;"): U_RULE_MASK_ERROR
50
51Warning: Transliterator::createFromRules(): transliterator_create_from_rules: unable to create ICU transliterator from rules (parse error at offset 0, before or at "ffff") in %s on line %d
52transliterator_create_from_rules: unable to create ICU transliterator from rules (parse error at offset 0, before or at "ffff"): U_MISSING_OPERATOR
53Done.
54