breakiter_factories_basic.phpt 958 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. IntlBreakIterator factories: basic tests
  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", "ja");
  11. $m = array('createWordInstance', 'createLineInstance', 'createCharacterInstance',
  12. 'createSentenceInstance', 'createTitleInstance');
  13. $t = 'Frase 1... Frase 2'.
  14. $o1 = $o2 = null;
  15. foreach ($m as $method) {
  16. echo "===== $method =====\n";
  17. $o1 = call_user_func(array('IntlBreakIterator', $method), 'ja');
  18. var_dump($o1 == $o2);
  19. $o2 = call_user_func(array('IntlBreakIterator', $method), NULL);
  20. var_dump($o1 == $o2);
  21. echo "\n";
  22. }
  23. --EXPECT--
  24. ===== createWordInstance =====
  25. bool(false)
  26. bool(true)
  27. ===== createLineInstance =====
  28. bool(false)
  29. bool(true)
  30. ===== createCharacterInstance =====
  31. bool(false)
  32. bool(true)
  33. ===== createSentenceInstance =====
  34. bool(false)
  35. bool(true)
  36. ===== createTitleInstance =====
  37. bool(false)
  38. bool(true)