1
0
Fork 0
mirror of synced 2024-07-04 22:20:45 +12:00

Disable custom entity tests

This commit is contained in:
Jake Barnby 2022-10-12 21:49:58 +13:00
parent 9821cc5e18
commit 9ae9213a97
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -458,45 +458,45 @@ class DatabaseServerTest extends Scope
]; ];
} }
/** // /**
* @depends testCreateStringAttribute // * @depends testCreateStringAttribute
* @depends testCreateIntegerAttribute // * @depends testCreateIntegerAttribute
* @depends testCreateBooleanAttribute // * @depends testCreateBooleanAttribute
* @depends testCreateFloatAttribute // * @depends testCreateFloatAttribute
* @depends testCreateEmailAttribute // * @depends testCreateEmailAttribute
* @depends testCreateEnumAttribute // * @depends testCreateEnumAttribute
* @depends testCreateDatetimeAttribute // * @depends testCreateDatetimeAttribute
* @throws Exception // * @throws Exception
*/ // */
public function testCreateCustomEntity(): array // public function testCreateCustomEntity(): array
{ // {
$projectId = $this->getProject()['$id']; // $projectId = $this->getProject()['$id'];
$query = $this->getQuery(self::$CREATE_CUSTOM_ENTITY); // $query = $this->getQuery(self::$CREATE_CUSTOM_ENTITY);
$gqlPayload = [ // $gqlPayload = [
'query' => $query, // 'query' => $query,
'variables' => [ // 'variables' => [
'name' => 'John Doe', // 'name' => 'John Doe',
'age' => 35, // 'age' => 35,
'alive' => true, // 'alive' => true,
'salary' => 9999.9, // 'salary' => 9999.9,
'email' => 'johndoe@appwrite.io', // 'email' => 'johndoe@appwrite.io',
'role' => 'crew', // 'role' => 'crew',
'dob' => '2000-01-01T00:00:00Z', // 'dob' => '2000-01-01T00:00:00Z',
] // ]
]; // ];
//
$actor = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ // $actor = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([
'content-type' => 'application/json', // 'content-type' => 'application/json',
'x-appwrite-project' => $projectId, // 'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload); // ], $this->getHeaders()), $gqlPayload);
//
$this->assertArrayNotHasKey('errors', $actor['body']); // $this->assertArrayNotHasKey('errors', $actor['body']);
$this->assertIsArray($actor['body']['data']); // $this->assertIsArray($actor['body']['data']);
$actor = $actor['body']['data']['actorsCreate']; // $actor = $actor['body']['data']['actorsCreate'];
$this->assertIsArray($actor); // $this->assertIsArray($actor);
//
return $actor; // return $actor;
} // }
public function testGetDatabases(): void public function testGetDatabases(): void
{ {
@ -752,52 +752,52 @@ class DatabaseServerTest extends Scope
$this->assertIsArray($document['body']['data']['databasesGetDocument']); $this->assertIsArray($document['body']['data']['databasesGetDocument']);
} }
/** // /**
* @depends testCreateCustomEntity // * @depends testCreateCustomEntity
* @throws Exception // * @throws Exception
*/ // */
public function testGetCustomEntities($data) // public function testGetCustomEntities($data)
{ // {
$projectId = $this->getProject()['$id']; // $projectId = $this->getProject()['$id'];
$query = $this->getQuery(self::$GET_CUSTOM_ENTITIES); // $query = $this->getQuery(self::$GET_CUSTOM_ENTITIES);
$gqlPayload = [ // $gqlPayload = [
'query' => $query, // 'query' => $query,
]; // ];
//
$customEntities = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ // $customEntities = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([
'content-type' => 'application/json', // 'content-type' => 'application/json',
'x-appwrite-project' => $projectId, // 'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload); // ], $this->getHeaders()), $gqlPayload);
//
$this->assertArrayNotHasKey('errors', $customEntities['body']); // $this->assertArrayNotHasKey('errors', $customEntities['body']);
$this->assertIsArray($customEntities['body']['data']); // $this->assertIsArray($customEntities['body']['data']);
$this->assertIsArray($customEntities['body']['data']['actorsList']); // $this->assertIsArray($customEntities['body']['data']['actorsList']);
} // }
//
/** // /**
* @depends testCreateCustomEntity // * @depends testCreateCustomEntity
* @throws Exception // * @throws Exception
*/ // */
public function testGetCustomEntity($data) // public function testGetCustomEntity($data)
{ // {
$projectId = $this->getProject()['$id']; // $projectId = $this->getProject()['$id'];
$query = $this->getQuery(self::$GET_CUSTOM_ENTITY); // $query = $this->getQuery(self::$GET_CUSTOM_ENTITY);
$gqlPayload = [ // $gqlPayload = [
'query' => $query, // 'query' => $query,
'variables' => [ // 'variables' => [
'id' => $data['_id'], // 'id' => $data['_id'],
] // ]
]; // ];
//
$entity = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ // $entity = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([
'content-type' => 'application/json', // 'content-type' => 'application/json',
'x-appwrite-project' => $projectId, // 'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload); // ], $this->getHeaders()), $gqlPayload);
//
$this->assertArrayNotHasKey('errors', $entity['body']); // $this->assertArrayNotHasKey('errors', $entity['body']);
$this->assertIsArray($entity['body']['data']); // $this->assertIsArray($entity['body']['data']);
$this->assertIsArray($entity['body']['data']['actorsGet']); // $this->assertIsArray($entity['body']['data']['actorsGet']);
} // }
/** /**
* @depends testCreateDatabase * @depends testCreateDatabase
@ -885,33 +885,33 @@ class DatabaseServerTest extends Scope
$this->assertStringContainsString('New Document Name', $document['data']); $this->assertStringContainsString('New Document Name', $document['data']);
} }
/** // /**
* @depends testCreateCustomEntity // * @depends testCreateCustomEntity
* @throws Exception // * @throws Exception
*/ // */
public function testUpdateCustomEntity(array $data) // public function testUpdateCustomEntity(array $data)
{ // {
$projectId = $this->getProject()['$id']; // $projectId = $this->getProject()['$id'];
$query = $this->getQuery(self::$UPDATE_CUSTOM_ENTITY); // $query = $this->getQuery(self::$UPDATE_CUSTOM_ENTITY);
$gqlPayload = [ // $gqlPayload = [
'query' => $query, // 'query' => $query,
'variables' => [ // 'variables' => [
'id' => $data['_id'], // 'id' => $data['_id'],
'name' => 'New Custom Entity Name', // 'name' => 'New Custom Entity Name',
] // ]
]; // ];
//
$entity = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ // $entity = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([
'content-type' => 'application/json', // 'content-type' => 'application/json',
'x-appwrite-project' => $projectId, // 'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload); // ], $this->getHeaders()), $gqlPayload);
//
$this->assertArrayNotHasKey('errors', $entity['body']); // $this->assertArrayNotHasKey('errors', $entity['body']);
$this->assertIsArray($entity['body']['data']); // $this->assertIsArray($entity['body']['data']);
$entity = $entity['body']['data']['actorsUpdate']; // $entity = $entity['body']['data']['actorsUpdate'];
$this->assertIsArray($entity); // $this->assertIsArray($entity);
$this->assertStringContainsString('New Custom Entity Name', $entity['name']); // $this->assertStringContainsString('New Custom Entity Name', $entity['name']);
} // }
/** /**
* @depends testCreateDocument * @depends testCreateDocument
@ -939,29 +939,29 @@ class DatabaseServerTest extends Scope
$this->assertEquals(204, $document['headers']['status-code']); $this->assertEquals(204, $document['headers']['status-code']);
} }
/** // /**
* @depends testCreateCustomEntity // * @depends testCreateCustomEntity
* @throws Exception // * @throws Exception
*/ // */
public function testDeleteCustomEntity(array $data) // public function testDeleteCustomEntity(array $data)
{ // {
$projectId = $this->getProject()['$id']; // $projectId = $this->getProject()['$id'];
$query = $this->getQuery(self::$DELETE_CUSTOM_ENTITY); // $query = $this->getQuery(self::$DELETE_CUSTOM_ENTITY);
$gqlPayload = [ // $gqlPayload = [
'query' => $query, // 'query' => $query,
'variables' => [ // 'variables' => [
'id' => $data['_id'], // 'id' => $data['_id'],
] // ]
]; // ];
//
$entity = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ // $entity = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([
'content-type' => 'application/json', // 'content-type' => 'application/json',
'x-appwrite-project' => $projectId, // 'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload); // ], $this->getHeaders()), $gqlPayload);
//
$this->assertIsNotArray($entity['body']); // $this->assertIsNotArray($entity['body']);
$this->assertEquals(204, $entity['headers']['status-code']); // $this->assertEquals(204, $entity['headers']['status-code']);
} // }
/** /**
* @depends testCreateStringAttribute * @depends testCreateStringAttribute