breakiter_getLocale_error.phpt 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. IntlBreakIterator::getLocale(): arg errors
  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. $bi = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;');
  11. $bi->setText("\x80sdfé\x90d888 dfsa9");
  12. var_dump($bi->getLocale(1, 2));
  13. var_dump($bi->getLocale(array()));
  14. var_dump($bi->getLocale());
  15. --EXPECTF--
  16. Warning: IntlBreakIterator::getLocale() expects exactly 1 parameter, 2 given in %s on line %d
  17. Warning: IntlBreakIterator::getLocale(): breakiter_get_locale: bad arguments in %s on line %d
  18. bool(false)
  19. Warning: IntlBreakIterator::getLocale() expects parameter 1 to be long, array given in %s on line %d
  20. Warning: IntlBreakIterator::getLocale(): breakiter_get_locale: bad arguments in %s on line %d
  21. bool(false)
  22. Warning: IntlBreakIterator::getLocale() expects exactly 1 parameter, 0 given in %s on line %d
  23. Warning: IntlBreakIterator::getLocale(): breakiter_get_locale: bad arguments in %s on line %d
  24. bool(false)