aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/languages/LanguageHuTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/languages/LanguageHuTest.php')
-rw-r--r--tests/phpunit/includes/languages/LanguageHuTest.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/phpunit/includes/languages/LanguageHuTest.php b/tests/phpunit/includes/languages/LanguageHuTest.php
index a8b0a578840e..445d164a65f5 100644
--- a/tests/phpunit/includes/languages/LanguageHuTest.php
+++ b/tests/phpunit/includes/languages/LanguageHuTest.php
@@ -35,4 +35,29 @@ class LanguageHuTest extends LanguageClassesTestCase {
[ 'other', 200 ],
];
}
+
+ /**
+ * @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 = [
+ 'kocsmafal' => [
+ 'rol' => 'kocsmafalról',
+ 'ba' => 'kocsmafalba',
+ ],
+ 'Bevezető' => [
+ 'k' => 'Bevezetők',
+ ],
+ ];
+
+ foreach ( $wordCaseMappings as $word => $caseMappings ) {
+ foreach ( $caseMappings as $case => $expected ) {
+ yield "$word $case" => [ (string)$word, $case, $expected ];
+ }
+ }
+ }
}