breakiter_createCodePointInstance_basic.phpt 792 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. IntlBreakIterator::createCodePointInstance(): 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. $text = 'ตัวอย่างข้อความ';
  12. $codepoint_it = IntlBreakIterator::createCodePointInstance();
  13. var_dump(get_class($codepoint_it));
  14. $codepoint_it->setText($text);
  15. print_r(iterator_to_array($codepoint_it));
  16. ?>
  17. ==DONE==
  18. --EXPECT--
  19. string(26) "IntlCodePointBreakIterator"
  20. Array
  21. (
  22. [0] => 0
  23. [1] => 3
  24. [2] => 6
  25. [3] => 9
  26. [4] => 12
  27. [5] => 15
  28. [6] => 18
  29. [7] => 21
  30. [8] => 24
  31. [9] => 27
  32. [10] => 30
  33. [11] => 33
  34. [12] => 36
  35. [13] => 39
  36. [14] => 42
  37. [15] => 45
  38. )
  39. ==DONE==