1
0
Fork 0
mirror of synced 2024-06-16 17:54:53 +12:00

add e2e tests for locale/languages

This commit is contained in:
Torsten Dittmann 2020-05-24 15:07:05 +02:00
parent 65f63bb769
commit d01373d8d4

View file

@ -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
{
/**