breakiter_preceding_basic.phpt 568 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. IntlBreakIterator::preceding(): basic test, ICU <= 57.1
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('intl'))
  6. die('skip intl extension not enabled');
  7. if (version_compare(INTL_ICU_VERSION, '57.1') > 0) die('skip for ICU <= 57.1');
  8. ?>
  9. --FILE--
  10. <?php
  11. ini_set("intl.error_level", E_WARNING);
  12. ini_set("intl.default_locale", "pt_PT");
  13. $bi = IntlBreakIterator::createWordInstance('pt');
  14. $bi->setText('foo bar trans zoo bee');
  15. var_dump($bi->preceding(5));
  16. var_dump($bi->preceding(50));
  17. var_dump($bi->preceding(-1));
  18. ?>
  19. ==DONE==
  20. --EXPECT--
  21. int(4)
  22. int(21)
  23. int(0)
  24. ==DONE==