diff options
author | Mostafa Ahangarha <ahangarha@riseup.net> | 2023-12-18 00:40:12 +0330 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-09-23 16:59:21 +0200 |
commit | d94745201b2e17805833ad0c1763c37bd009f513 (patch) | |
tree | 7637aa1163b96dc31b1b425ec003303631003efb /tests | |
parent | 2b7efd66b6deb7fca62046a54b8ca0fe0310fe34 (diff) | |
download | nextcloud-server-d94745201b2e17805833ad0c1763c37bd009f513.tar.gz nextcloud-server-d94745201b2e17805833ad0c1763c37bd009f513.zip |
fix(rtl): Add unittest for language direction
Signed-off-by: Mostafa Ahangarha <ahangarha@riseup.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/L10N/FactoryTest.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/L10N/FactoryTest.php b/tests/lib/L10N/FactoryTest.php index 0f243c124ca..510c165eba9 100644 --- a/tests/lib/L10N/FactoryTest.php +++ b/tests/lib/L10N/FactoryTest.php @@ -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)); + } } |