LanguageDsbTest.php 933 B

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