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--EXPECTF--
34Warning: Transliterator::createFromRules() expects at least 1 parameter, 0 given in %s on line %d
35
36Warning: Transliterator::createFromRules(): transliterator_create_from_rules: bad arguments in %s on line %d
37transliterator_create_from_rules: bad arguments: U_ILLEGAL_ARGUMENT_ERROR
38
39Warning: Transliterator::createFromRules() expects parameter 2 to be integer, string given in %s on line %d
40
41Warning: Transliterator::createFromRules(): transliterator_create_from_rules: bad arguments in %s on line %d
42transliterator_create_from_rules: bad arguments: U_ILLEGAL_ARGUMENT_ERROR
43
44Warning: Transliterator::createFromRules(): String conversion of rules to UTF-16 failed in %s on line %d
45String conversion of rules to UTF-16 failed: U_INVALID_CHAR_FOUND
46
47Warning: 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
48transliterator_create_from_rules: unable to create ICU transliterator from rules (parse error after "{'``'}a > “;", before or at "{'``'}a > b;"): U_RULE_MASK_ERROR
49
50Warning: 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
51transliterator_create_from_rules: unable to create ICU transliterator from rules (parse error at offset 0, before or at "ffff"): U_MISSING_OPERATOR
52Done.
53