Skip to content

Commit

Permalink
Add unittest for language direction
Browse files Browse the repository at this point in the history
Signed-off-by: Mostafa Ahangarha <[email protected]>
  • Loading branch information
ahangarha authored and nickvergessen committed Aug 20, 2024
1 parent a6268fb commit 08ff13d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/lib/L10N/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -775,4 +775,22 @@ public function testGetLanguageIterator(bool $hasSession, ?IUser $iUserMock = nu
$iterator = $factory->getLanguageIterator($iUserMock);
self::assertInstanceOf(ILanguageIterator::class, $iterator);
}

public static function languagesWithRespectedDirection():array {
return [
['en', 'ltr'],
['de', 'ltr'],
['fa', 'rtl'],
['ar', 'rtl']
];
}

/**
* @dataProvider languagesWithRespectedDirection
*/
public function testDirectionOfLocales(string $locale, string $expectedDirection) {
$factory = $this->getFactory();

self::assertEquals($expectedDirection, $factory->getLanguageDirectionFromLocale($locale));
}
}

0 comments on commit 08ff13d

Please sign in to comment.