LanguageBsTest.php 979 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * @author Santhosh Thottingal
  4. * @copyright Copyright © 2012, Santhosh Thottingal
  5. * @file
  6. */
  7. /**
  8. * Tests for Croatian (hrvatski)
  9. *
  10. * @covers LanguageBs
  11. */
  12. class LanguageBsTest extends LanguageClassesTestCase {
  13. /**
  14. * @dataProvider providePlural
  15. * @covers Language::convertPlural
  16. */
  17. public function testPlural( $result, $value ) {
  18. $forms = [ 'one', 'few', 'other' ];
  19. $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
  20. }
  21. /**
  22. * @dataProvider providePlural
  23. * @covers Language::getPluralRuleType
  24. */
  25. public function testGetPluralRuleType( $result, $value ) {
  26. $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
  27. }
  28. public static function providePlural() {
  29. return [
  30. [ 'other', 0 ],
  31. [ 'one', 1 ],
  32. [ 'few', 2 ],
  33. [ 'few', 4 ],
  34. [ 'other', 5 ],
  35. [ 'other', 11 ],
  36. [ 'other', 20 ],
  37. [ 'one', 21 ],
  38. [ 'few', 24 ],
  39. [ 'other', 25 ],
  40. [ 'other', 200 ],
  41. ];
  42. }
  43. }