1
0
Fork 0
mirror of synced 2024-05-16 02:32:40 +12:00

Remove redundant test class prefixes

This commit is contained in:
Jake Barnby 2022-09-22 20:29:42 +12:00
parent a5b31b1956
commit 5bd420a823
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
20 changed files with 100 additions and 66 deletions

35
.gitattributes vendored
View file

@ -1,28 +1,7 @@
app/config/* linguist-detectable=false app/config/** linguist-detectable=false
app/config/*/* linguist-detectable=false app/views/** linguist-detectable=false
app/config/*/*/* linguist-detectable=false app/controllers/** linguist-detectable=false
app/config/*/*/*/* linguist-detectable=false src/** linguist-detectable=false
app/views/* linguist-detectable=false tests/** linguist-detectable=false
app/views/*/* linguist-detectable=false public/scripts/** linguist-detectable=false
app/views/*/*/* linguist-detectable=false public/dist/scripts/** linguist-detectable=false
app/views/*/*/*/* linguist-detectable=false
app/controllers/* linguist-detectable=false
app/controllers/*/* linguist-detectable=false
app/controllers/*/*/* linguist-detectable=false
app/controllers/*/*/*/* linguist-detectable=false
app/controllers/*/*/*/*/* linguist-detectable=false
src/* linguist-detectable=false
src/*/* linguist-detectable=false
src/*/*/* linguist-detectable=false
src/*/*/*/* linguist-detectable=false
src/*/*/*/*/* linguist-detectable=false
tests/* linguist-detectable=false
tests/*/* linguist-detectable=false
tests/*/*/* linguist-detectable=false
tests/*/*/*/* linguist-detectable=false
tests/*/*/*/*/* linguist-detectable=false
tests/*/*/*/*/*/* linguist-detectable=false
public/scripts/* linguist-detectable=false
public/scripts/*/*/* linguist-detectable=false
public/scripts/*/*/*/* linguist-detectable=false
public/dist/scripts/* linguist-detectable=false

View file

@ -10,11 +10,11 @@ use Utopia\App;
use Utopia\Database\Permission; use Utopia\Database\Permission;
use Utopia\Database\Role; use Utopia\Database\Role;
class GraphQLAbuseTest extends Scope class AbuseTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideServer; use SideServer;
use GraphQLBase; use Base;
public function testComplexQueryBlocked() public function testComplexQueryBlocked()
{ {

View file

@ -8,11 +8,11 @@ use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient; use Tests\E2E\Scopes\SideClient;
use Utopia\Database\ID; use Utopia\Database\ID;
class GraphQLAccountTest extends Scope class AccountTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideClient; use SideClient;
use GraphQLBase; use Base;
public function testCreateAccount(): array public function testCreateAccount(): array
{ {

View file

@ -10,11 +10,11 @@ use Utopia\Database\ID;
use Utopia\Database\Role; use Utopia\Database\Role;
use Utopia\Database\Permission; use Utopia\Database\Permission;
class GraphQLAuthTest extends Scope class AuthTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideClient; use SideClient;
use GraphQLBase; use Base;
private array $account1; private array $account1;
private array $account2; private array $account2;
@ -79,6 +79,7 @@ class GraphQLAuthTest extends Scope
// Create session 2 // Create session 2
$graphQLPayload['variables']['email'] = $email2; $graphQLPayload['variables']['email'] = $email2;
$session2 = $this->client->call(Client::METHOD_POST, '/graphql', [ $session2 = $this->client->call(Client::METHOD_POST, '/graphql', [
'content-type' => 'application/json', 'content-type' => 'application/json',
'x-appwrite-project' => $projectId, 'x-appwrite-project' => $projectId,

View file

@ -7,11 +7,11 @@ use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer; use Tests\E2E\Scopes\SideServer;
class GraphQLAvatarsTest extends Scope class AvatarsTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideServer; use SideServer;
use GraphQLBase; use Base;
public function testGetCreditCardIcon() public function testGetCreditCardIcon()
{ {

View file

@ -2,7 +2,7 @@
namespace Tests\E2E\Services\GraphQL; namespace Tests\E2E\Services\GraphQL;
trait GraphQLBase trait Base
{ {
// Databases // Databases
public static string $CREATE_DATABASE = 'create_database'; public static string $CREATE_DATABASE = 'create_database';
@ -560,8 +560,8 @@ trait GraphQLBase
} }
}'; }';
case self::$GET_USERS: case self::$GET_USERS:
return 'query listUsers($search: String, $queries: [String!]) { return 'query listUsers($queries: [String!], $search: String) {
usersList(search: $search, queries: $queries) { usersList(queries: $queries, search: $search) {
total total
users { users {
_id _id

View file

@ -8,7 +8,7 @@ use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient; use Tests\E2E\Scopes\SideClient;
use Utopia\Database\ID; use Utopia\Database\ID;
class GraphQLBatchTest extends Scope class BatchTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideClient; use SideClient;

View file

@ -11,11 +11,11 @@ use Utopia\Database\ID;
use Utopia\Database\Permission; use Utopia\Database\Permission;
use Utopia\Database\Role; use Utopia\Database\Role;
class GraphQLContentTypeTest extends Scope class ContentTypeTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideServer; use SideServer;
use GraphQLBase; use Base;
public function testGraphQLContentType() public function testGraphQLContentType()
{ {

View file

@ -10,11 +10,11 @@ use Utopia\Database\ID;
use Utopia\Database\Permission; use Utopia\Database\Permission;
use Utopia\Database\Role; use Utopia\Database\Role;
class GraphQLDatabaseClientTest extends Scope class DatabaseClientTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideClient; use SideClient;
use GraphQLBase; use Base;
public function testCreateDatabase(): array public function testCreateDatabase(): array
{ {

View file

@ -11,11 +11,11 @@ use Utopia\Database\ID;
use Utopia\Database\Permission; use Utopia\Database\Permission;
use Utopia\Database\Role; use Utopia\Database\Role;
class GraphQLDatabaseServerTest extends Scope class DatabaseServerTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideServer; use SideServer;
use GraphQLBase; use Base;
public function testCreateDatabase(): array public function testCreateDatabase(): array
{ {
@ -862,6 +862,37 @@ class GraphQLDatabaseServerTest extends Scope
$this->assertStringContainsString('New Document Name', $document['data']); $this->assertStringContainsString('New Document Name', $document['data']);
} }
// /**
// * @depends testCreateCustomEntity
// * @throws Exception
// */
// public function testUpdateCustomEntity(array $data) {
// $projectId = $this->getProject()['$id'];
// $query = $this->getQuery(self::$UPDATE_CUSTOM_ENTITY);
// $gqlPayload = [
// 'query' => $query,
// 'variables' => [
// 'id' => $data['_id'],
// 'data' => [
// 'name' => 'New Custom Entity Name',
// ],
// ]
// ];
//
// $entity = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([
// 'content-type' => 'application/json',
// 'x-appwrite-project' => $projectId,
// ], $this->getHeaders()), $gqlPayload);
//
// \var_dump($entity);
//
// $this->assertArrayNotHasKey('errors', $entity['body']);
// $this->assertIsArray($entity['body']['data']);
// $entity = $entity['body']['data']['actorsUpdate'];
// $this->assertIsArray($entity);
// $this->assertStringContainsString('New Custom Entity Name', $entity['data']);
// }
/** /**
* @depends testCreateDocument * @depends testCreateDocument
* @throws Exception * @throws Exception
@ -965,4 +996,27 @@ class GraphQLDatabaseServerTest extends Scope
$this->assertIsNotArray($database['body']); $this->assertIsNotArray($database['body']);
$this->assertEquals(204, $database['headers']['status-code']); $this->assertEquals(204, $database['headers']['status-code']);
} }
// /**
// * @depends testCreateCustomEntity
// * @throws Exception
// */
// public function testDeleteCustomEntity(array $data) {
// $projectId = $this->getProject()['$id'];
// $query = $this->getQuery(self::$DELETE_CUSTOM_ENTITY);
// $gqlPayload = [
// 'query' => $query,
// 'variables' => [
// 'id' => $data['_id'],
// ]
// ];
//
// $entity = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([
// 'content-type' => 'application/json',
// 'x-appwrite-project' => $projectId,
// ], $this->getHeaders()), $gqlPayload);
//
// $this->assertIsNotArray($entity['body']);
// $this->assertEquals(204, $entity['headers']['status-code']);
// }
} }

View file

@ -10,11 +10,11 @@ use Tests\E2E\Scopes\SideClient;
use Utopia\Database\ID; use Utopia\Database\ID;
use Utopia\Database\Role; use Utopia\Database\Role;
class GraphQLFunctionsClientTest extends Scope class FunctionsClientTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideClient; use SideClient;
use GraphQLBase; use Base;
public function testCreateFunction(): array public function testCreateFunction(): array
{ {

View file

@ -10,11 +10,11 @@ use Tests\E2E\Scopes\SideServer;
use Utopia\Database\ID; use Utopia\Database\ID;
use Utopia\Database\Role; use Utopia\Database\Role;
class GraphQLFunctionsServerTest extends Scope class FunctionsServerTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideServer; use SideServer;
use GraphQLBase; use Base;
public function testCreateFunction(): array public function testCreateFunction(): array
{ {

View file

@ -7,11 +7,11 @@ use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer; use Tests\E2E\Scopes\SideServer;
class GraphQLHealthTest extends Scope class HealthTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideServer; use SideServer;
use GraphQLBase; use Base;
public function testGetHTTPHealth() public function testGetHTTPHealth()
{ {

View file

@ -7,11 +7,11 @@ use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer; use Tests\E2E\Scopes\SideServer;
class GraphQLLocalizationTest extends Scope class LocalizationTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideServer; use SideServer;
use GraphQLBase; use Base;
public function testGetLocale(): array public function testGetLocale(): array
{ {

View file

@ -9,11 +9,11 @@ use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Scopes\SideServer; use Tests\E2E\Scopes\SideServer;
use Utopia\Database\ID; use Utopia\Database\ID;
class GraphQLScopeTest extends Scope class ScopeTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideServer; use SideServer;
use GraphQLBase; use Base;
public function testInvalidScope() public function testInvalidScope()
{ {

View file

@ -11,11 +11,11 @@ use Utopia\Database\ID;
use Utopia\Database\Permission; use Utopia\Database\Permission;
use Utopia\Database\Role; use Utopia\Database\Role;
class GraphQLStorageClientTest extends Scope class StorageClientTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideClient; use SideClient;
use GraphQLBase; use Base;
public function testCreateBucket(): array public function testCreateBucket(): array
{ {

View file

@ -11,11 +11,11 @@ use Utopia\Database\ID;
use Utopia\Database\Permission; use Utopia\Database\Permission;
use Utopia\Database\Role; use Utopia\Database\Role;
class GraphQLStorageServerTest extends Scope class StorageServerTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideServer; use SideServer;
use GraphQLBase; use Base;
public function testCreateBucket(): array public function testCreateBucket(): array
{ {

View file

@ -8,10 +8,10 @@ use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient; use Tests\E2E\Scopes\SideClient;
use Utopia\Database\ID; use Utopia\Database\ID;
class GraphQLTeamsClientTest extends Scope class TeamsClientTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use GraphQLBase; use Base;
use SideClient; use SideClient;
public function testCreateTeam(): array public function testCreateTeam(): array

View file

@ -8,10 +8,10 @@ use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer; use Tests\E2E\Scopes\SideServer;
use Utopia\Database\ID; use Utopia\Database\ID;
class GraphQLTeamsServerTest extends Scope class TeamsServerTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use GraphQLBase; use Base;
use SideServer; use SideServer;
public function testCreateTeam(): array public function testCreateTeam(): array

View file

@ -9,11 +9,11 @@ use Tests\E2E\Scopes\SideServer;
use Utopia\Database\ID; use Utopia\Database\ID;
use Utopia\Database\Query; use Utopia\Database\Query;
class GraphQLUsersTest extends Scope class UsersTest extends Scope
{ {
use ProjectCustom; use ProjectCustom;
use SideServer; use SideServer;
use GraphQLBase; use Base;
public function testCreateUser(): array public function testCreateUser(): array
{ {