mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Updated server tests
This commit is contained in:
@@ -11,9 +11,8 @@ trait SideServer
|
||||
|
||||
public function getHeaders():array
|
||||
{
|
||||
|
||||
return [
|
||||
'x-appwrite-key' => $this->getProject()
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,22 +9,7 @@ use Tests\E2E\Scopes\SideServer;
|
||||
|
||||
class AvatarsCustomServerTest extends Scope
|
||||
{
|
||||
use AvatarsBase;
|
||||
use ProjectCustom;
|
||||
use SideServer;
|
||||
|
||||
public function testGetCreditCard():array
|
||||
{
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/avatars/credit-cards/visa', [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$uid'],
|
||||
'X-appwrite-key' => $this->getProject()['apiKey'],
|
||||
]);
|
||||
|
||||
$this->assertEquals(401, $response['headers']['status-code']);
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,12 @@ trait LocaleBase
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale', [
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$uid'],
|
||||
]);
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertArrayHasKey('ip', $response['body']);
|
||||
$this->assertArrayHasKey('countryCode', $response['body']);
|
||||
$this->assertArrayHasKey('country', $response['body']);
|
||||
@@ -27,7 +28,7 @@ trait LocaleBase
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -36,10 +37,10 @@ trait LocaleBase
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale/countries', [
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale/countries', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$uid'],
|
||||
]);
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
@@ -71,10 +72,10 @@ trait LocaleBase
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale/countries/eu', [
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale/countries/eu', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$uid'],
|
||||
]);
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
@@ -106,10 +107,10 @@ trait LocaleBase
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale/countries/phones', [
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale/countries/phones', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$uid'],
|
||||
]);
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
@@ -129,10 +130,10 @@ trait LocaleBase
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale/continents', [
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale/continents', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$uid'],
|
||||
]);
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
@@ -164,10 +165,10 @@ trait LocaleBase
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale/currencies', [
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale/currencies', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$uid'],
|
||||
]);
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
|
||||
@@ -9,22 +9,9 @@ use Tests\E2E\Scopes\SideServer;
|
||||
|
||||
class LocaleCustomServerTest extends Scope
|
||||
{
|
||||
use LocaleBase;
|
||||
use ProjectCustom;
|
||||
use SideServer;
|
||||
|
||||
public function testCreateLocale():array
|
||||
{
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/avatars/credit-cards/visa', [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$uid'],
|
||||
'X-appwrite-key' => $this->getProject()['apiKey'],
|
||||
]);
|
||||
|
||||
$this->assertEquals(401, $response['headers']['status-code']);
|
||||
|
||||
return [];
|
||||
}
|
||||
///$this->getHeaders()
|
||||
}
|
||||
Reference in New Issue
Block a user