rbbiter___construct_basic.phpt 861 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. IntlRuleBasedBreakIterator::__construct: basic test
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('intl'))
  6. die('skip intl extension not enabled');
  7. --FILE--
  8. <?php
  9. ini_set("intl.error_level", E_WARNING);
  10. ini_set("intl.default_locale", "pt_PT");
  11. $rules = <<<RULES
  12. \$LN = [[:letter:] [:number:]];
  13. \$S = [.;,:];
  14. !!forward;
  15. \$LN+ {1};
  16. \$S+ {42};
  17. !!reverse;
  18. \$LN+ {1};
  19. \$S+ {42};
  20. !!safe_forward;
  21. !!safe_reverse;
  22. RULES;
  23. $rbbi = new IntlRuleBasedBreakIterator($rules);
  24. var_dump(get_class($rbbi));
  25. try {
  26. $obj = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+', 'aoeu');
  27. } catch (IntlException $e) {
  28. var_dump(intl_get_error_code(), intl_get_error_message());
  29. }
  30. ?>
  31. ==DONE==
  32. --EXPECT--
  33. string(26) "IntlRuleBasedBreakIterator"
  34. int(1)
  35. string(93) "rbbi_create_instance: unable to create instance from compiled rules: U_ILLEGAL_ARGUMENT_ERROR"
  36. ==DONE==