word = word.slice( 0, -2 ) + 'ки';
} else if ( word.slice( -2 ) === 'ти' ) {
word = word.slice( 0, -2 ) + 'тей';
- } else if ( word.slice( -2 ) === 'ды' ) {
- word = word.slice( 0, -2 ) + 'дов';
+ } else if ( word.slice( -2 ) === 'ди' ) {
+ word = word.slice( 0, -2 ) + 'дів';
} else if ( word.slice( -3 ) === 'ник' ) {
word = word.slice( 0, -3 ) + 'ника';
}
array( 'other', 121 ),
);
}
+
+ /**
+ * @dataProvider providerGrammar
+ * @covers Language::convertGrammar
+ */
+ public function testGrammar( $result, $word, $case ) {
+ $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
+ }
+
+ public static function providerGrammar() {
+ return array(
+ array(
+ 'Вікіпедії',
+ 'Вікіпедія',
+ 'genitive',
+ ),
+ array(
+ 'Віківидів',
+ 'Віківиди',
+ 'genitive',
+ ),
+ array(
+ 'Вікіпедію',
+ 'Вікіпедія',
+ 'accusative',
+ ),
+ );
+ }
}
description: 'Grammar test for genitive case'
},
{
- word: 'доводÑ\8b',
+ word: 'Ð\92Ñ\96кÑ\96види',
grammarForm: 'genitive',
- expected: 'доводов',
+ expected: 'Ð\92Ñ\96кÑ\96видÑ\96в',
description: 'Grammar test for genitive case'
},
{