LanguageGvTest.php 969 B

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