LanguageLvTest.php 983 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * @author Santhosh Thottingal
  4. * @copyright Copyright © 2012, Santhosh Thottingal
  5. * @file
  6. */
  7. /** Tests for Latvian */
  8. class LanguageLvTest extends LanguageClassesTestCase {
  9. /**
  10. * @dataProvider providePlural
  11. * @covers Language::convertPlural
  12. */
  13. public function testPlural( $result, $value ) {
  14. $forms = [ 'zero', 'one', '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. [ 'zero', 0 ],
  27. [ 'one', 1 ],
  28. [ 'zero', 11 ],
  29. [ 'one', 21 ],
  30. [ 'zero', 411 ],
  31. [ 'other', 2 ],
  32. [ 'other', 9 ],
  33. [ 'zero', 12 ],
  34. [ 'other', 12.345 ],
  35. [ 'zero', 20 ],
  36. [ 'other', 22 ],
  37. [ 'one', 31 ],
  38. [ 'zero', 200 ],
  39. ];
  40. }
  41. }