diff --git a/tests/e2e/Scopes/SideServer.php b/tests/e2e/Scopes/SideServer.php index 0f69e597e..5da9b3311 100644 --- a/tests/e2e/Scopes/SideServer.php +++ b/tests/e2e/Scopes/SideServer.php @@ -11,9 +11,8 @@ trait SideServer public function getHeaders():array { - return [ - 'x-appwrite-key' => $this->getProject() + 'x-appwrite-key' => $this->getProject()['apiKey'] ]; } } diff --git a/tests/e2e/Services/Avatars/AvatarsCustomServerTest.php b/tests/e2e/Services/Avatars/AvatarsCustomServerTest.php index b162b2e79..4b22b29cb 100644 --- a/tests/e2e/Services/Avatars/AvatarsCustomServerTest.php +++ b/tests/e2e/Services/Avatars/AvatarsCustomServerTest.php @@ -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 []; - } } \ No newline at end of file diff --git a/tests/e2e/Services/Locale/LocaleBase.php b/tests/e2e/Services/Locale/LocaleBase.php index 7362b17f3..e2aeace8e 100644 --- a/tests/e2e/Services/Locale/LocaleBase.php +++ b/tests/e2e/Services/Locale/LocaleBase.php @@ -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']); diff --git a/tests/e2e/Services/Locale/LocaleCustomServerTest.php b/tests/e2e/Services/Locale/LocaleCustomServerTest.php index c028aeae0..dc23f5843 100644 --- a/tests/e2e/Services/Locale/LocaleCustomServerTest.php +++ b/tests/e2e/Services/Locale/LocaleCustomServerTest.php @@ -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() } \ No newline at end of file