mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
fix(rtl): Add unittest for language direction
Signed-off-by: Mostafa Ahangarha <ahangarha@riseup.net>
This commit is contained in:
parent
2b7efd66b6
commit
d94745201b
1 changed files with 18 additions and 0 deletions
|
|
@ -775,4 +775,22 @@ class FactoryTest extends TestCase {
|
|||
$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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue