diff options
Diffstat (limited to 'tests/phpunit/includes/languages/LanguageFiTest.php')
-rw-r--r-- | tests/phpunit/includes/languages/LanguageFiTest.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/phpunit/includes/languages/LanguageFiTest.php b/tests/phpunit/includes/languages/LanguageFiTest.php new file mode 100644 index 000000000000..fb9efd76e493 --- /dev/null +++ b/tests/phpunit/includes/languages/LanguageFiTest.php @@ -0,0 +1,40 @@ +<?php +declare( strict_types=1 ); + +/** + * @group Language + * @covers LanguageFi + */ +class LanguageFiTest extends LanguageClassesTestCase { + /** + * @dataProvider provideConvertGrammar + */ + public function testConvertGrammar( string $word, string $case, string $expected ): void { + $this->assertSame( $expected, $this->getLang()->convertGrammar( $word, $case ) ); + } + + public static function provideConvertGrammar(): iterable { + $wordCaseMappings = [ + 'talo' => [ + 'genitive' => 'talon', + 'elative' => 'talosta', + 'partitive' => 'taloa', + 'illative' => 'taloon', + 'inessive' => 'talossa', + ], + 'pastöroitu' => [ + 'partitive' => 'pastöroitua', + ], + 'Wikipedia' => [ + 'elative' => 'Wikipediasta', + 'partitive' => 'Wikipediaa', + ], + ]; + + foreach ( $wordCaseMappings as $word => $caseMappings ) { + foreach ( $caseMappings as $case => $expected ) { + yield "$word $case" => [ (string)$word, $case, $expected ]; + } + } + } +} |