LanguageShTest.php 987 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * @author Amir E. Aharoni
  4. * @copyright Copyright © 2012, Amir E. Aharoni
  5. * @file
  6. */
  7. /** Tests for srpskohrvatski / српскохрватски / Serbocroatian */
  8. class LanguageShTest extends LanguageClassesTestCase {
  9. /**
  10. * @dataProvider providePlural
  11. * @covers Language::convertPlural
  12. */
  13. public function testPlural( $result, $value ) {
  14. $forms = [ 'one', 'few', 'other' ];
  15. $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
  16. }
  17. /**
  18. * @dataProvider providePlural
  19. * @covers Language::getPluralRuleType
  20. */
  21. public function testGetPluralRuleType( $result, $value ) {
  22. $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
  23. }
  24. public static function providePlural() {
  25. return [
  26. [ 'other', 0 ],
  27. [ 'one', 1 ],
  28. [ 'few', 2 ],
  29. [ 'few', 4 ],
  30. [ 'other', 5 ],
  31. [ 'other', 10 ],
  32. [ 'other', 11 ],
  33. [ 'other', 12 ],
  34. [ 'one', 101 ],
  35. [ 'few', 102 ],
  36. [ 'other', 111 ],
  37. ];
  38. }
  39. }