Skip to content
Prev Previous commit
Next Next commit
Add unittest for language direction
Signed-off-by: Mostafa Ahangarha <[email protected]>
  • Loading branch information
ahangarha committed Jan 10, 2024
commit 11056ebadacf17359be3faa5e968ff9896f4032c
18 changes: 18 additions & 0 deletions tests/lib/L10N/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -700,4 +700,22 @@ public function testGetLanguageIterator(bool $hasSession, IUser $iUserMock = nul
$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 testDirectionForEnLocale(string $lang, string $expectedDirection) {
$factory = $this->getFactory();

self::assertEquals($expectedDirection, $factory->getLanguageDirection($lang));
}
}