From d01373d8d4d48b92092c976849581c0ea332e4ab Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Sun, 24 May 2020 15:07:05 +0200 Subject: [PATCH] add e2e tests for locale/languages --- tests/e2e/Services/Locale/LocaleBase.php | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/e2e/Services/Locale/LocaleBase.php b/tests/e2e/Services/Locale/LocaleBase.php index 5a3df45b2..863ab1757 100644 --- a/tests/e2e/Services/Locale/LocaleBase.php +++ b/tests/e2e/Services/Locale/LocaleBase.php @@ -183,6 +183,35 @@ trait LocaleBase return []; } + public function testGetLanguages():array + { + /** + * Test for SUCCESS + */ + $response = $this->client->call(Client::METHOD_GET, '/locale/langauges', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals($response['headers']['status-code'], 200); + $this->assertIsArray($response['body']); + $this->assertCount(184, $response['body']); + + $this->assertEquals($response['body'][0]['code'], 'aa'); + $this->assertEquals($response['body'][0]['name'], 'Afar'); + $this->assertEquals($response['body'][0]['nativeName'], 'Afar'); + + $this->assertEquals($response['body'][183]['code'], 'zu'); + $this->assertEquals($response['body'][183]['name'], 'Zulu'); + $this->assertEquals($response['body'][183]['nativeName'], 'isiZulu'); + + /** + * Test for FAILURE + */ + + return []; + } + public function testLangaugaes(): array { /**