2012-02-01 15:37:40 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* @author Amir E. Aharoni
|
|
|
|
|
* @copyright Copyright © 2012, Amir E. Aharoni
|
|
|
|
|
* @file
|
|
|
|
|
*/
|
|
|
|
|
|
2021-07-31 21:23:21 +00:00
|
|
|
/**
|
2020-01-27 17:06:18 +00:00
|
|
|
* @group Language
|
|
|
|
|
*/
|
2012-10-23 20:53:17 +00:00
|
|
|
class LanguageRoTest extends LanguageClassesTestCase {
|
2013-10-22 10:32:29 +00:00
|
|
|
/**
|
|
|
|
|
* @dataProvider providePlural
|
|
|
|
|
* @covers Language::convertPlural
|
|
|
|
|
*/
|
|
|
|
|
public function testPlural( $result, $value ) {
|
2016-02-17 09:09:32 +00:00
|
|
|
$forms = [ 'one', 'few', 'other' ];
|
2012-10-23 20:53:17 +00:00
|
|
|
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
|
2012-02-01 15:37:40 +00:00
|
|
|
}
|
|
|
|
|
|
2013-10-22 10:32:29 +00:00
|
|
|
/**
|
|
|
|
|
* @dataProvider providePlural
|
|
|
|
|
* @covers Language::getPluralRuleType
|
|
|
|
|
*/
|
|
|
|
|
public function testGetPluralRuleType( $result, $value ) {
|
2013-01-25 01:10:37 +00:00
|
|
|
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-22 02:12:37 +00:00
|
|
|
public static function providePlural() {
|
2016-02-17 09:09:32 +00:00
|
|
|
return [
|
|
|
|
|
[ 'few', 0 ],
|
|
|
|
|
[ 'one', 1 ],
|
|
|
|
|
[ 'few', 2 ],
|
|
|
|
|
[ 'few', 19 ],
|
|
|
|
|
[ 'other', 20 ],
|
|
|
|
|
[ 'other', 99 ],
|
|
|
|
|
[ 'other', 100 ],
|
|
|
|
|
[ 'few', 101 ],
|
|
|
|
|
[ 'few', 119 ],
|
|
|
|
|
[ 'other', 120 ],
|
|
|
|
|
[ 'other', 200 ],
|
|
|
|
|
[ 'few', 201 ],
|
|
|
|
|
[ 'few', 219 ],
|
|
|
|
|
[ 'other', 220 ],
|
|
|
|
|
];
|
2012-02-01 15:37:40 +00:00
|
|
|
}
|
|
|
|
|
}
|