1
0
Fork 0
mirror of synced 2024-06-25 17:50:38 +12:00

Added locale service tests

This commit is contained in:
eldadfux 2019-10-21 11:30:16 +03:00
parent 44baed0bd0
commit 95ad4c5ac6

View file

@ -66,7 +66,37 @@ class ProjectLocaleTest extends BaseProjects
/**
* @depends testRegisterSuccess
*/
public function testLocaleContinentReadSuccess($data)
public function testLocaleCountriesEUReadSuccess($data)
{
$countries = $this->client->call(Client::METHOD_GET, '/locale/countries/eu', [
'content-type' => 'application/json',
'x-appwrite-project' => $data['projectUid'],
]);
$this->assertEquals($countries['headers']['status-code'], 200);
$this->assertIsArray($countries['body']);
$this->assertCount(28, $countries['body']);
$this->assertEquals($countries['body']['DE'], 'Germany');
// Test locale code change to ES
$countries = $this->client->call(Client::METHOD_GET, '/locale/countries/eu', [
'content-type' => 'application/json',
'x-appwrite-locale' => 'es',
]);
$this->assertEquals($countries['headers']['status-code'], 200);
$this->assertIsArray($countries['body']);
$this->assertCount(28, $countries['body']);
$this->assertEquals($countries['body']['DE'], 'Alemania');
return $data;
}
/**
* @depends testRegisterSuccess
*/
public function testLocaleContinentsReadSuccess($data)
{
$continents = $this->client->call(Client::METHOD_GET, '/locale/continents', [
'content-type' => 'application/json',
@ -91,4 +121,23 @@ class ProjectLocaleTest extends BaseProjects
return $data;
}
/**
* @depends testRegisterSuccess
*/
public function testLocaleCurrenciesReadSuccess($data)
{
$continents = $this->client->call(Client::METHOD_GET, '/locale/currencies', [
'content-type' => 'application/json',
'x-appwrite-project' => $data['projectUid'],
]);
$this->assertEquals($continents['headers']['status-code'], 200);
$this->assertIsArray($continents['body']);
$this->assertCount(117, $continents['body']);
$this->assertEquals($continents['body'][0]['symbol'], '$');
$this->assertEquals($continents['body'][0]['name'], 'US Dollar');
return $data;
}
}