1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

test: fix gql tests

This commit is contained in:
loks0n 2023-12-12 11:50:30 +00:00
parent fda9df069a
commit 467f4eaa06
2 changed files with 21 additions and 14 deletions

View file

@ -152,10 +152,11 @@ class AccountTest extends Scope
],
];
$token = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
$token = $this->client->call(Client::METHOD_POST, '/graphql', [
'content-type' => 'application/json',
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
'origin' => 'http://localhost',
], $graphQLPayload);
$this->assertArrayNotHasKey('errors', $token['body']);
$this->assertIsArray($token['body']['data']);

View file

@ -89,10 +89,11 @@ class BatchTest extends Scope
],
]];
$response = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
$response = $this->client->call(Client::METHOD_POST, '/graphql', [
'content-type' => 'application/json',
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
'origin' => 'http://localhost',
], $graphQLPayload);
$this->assertIsArray($response['body'][0]['data']);
$this->assertIsArray($response['body'][1]['data']);
@ -136,10 +137,11 @@ class BatchTest extends Scope
],
];
$response = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
$response = $this->client->call(Client::METHOD_POST, '/graphql', [
'content-type' => 'application/json',
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
'origin' => 'http://localhost',
], $graphQLPayload);
$this->assertIsArray($response['body'][0]['data']);
$this->assertIsArray($response['body'][1]['data']);
@ -170,10 +172,11 @@ class BatchTest extends Scope
]
],
];
$response = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
$response = $this->client->call(Client::METHOD_POST, '/graphql', [
'content-type' => 'application/json',
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
'origin' => 'http://localhost',
], $graphQLPayload);
$this->assertIsArray($response['body'][0]['data']);
$this->assertIsArray($response['body'][1]['data']);
@ -211,10 +214,11 @@ class BatchTest extends Scope
]
],
];
$response = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
$response = $this->client->call(Client::METHOD_POST, '/graphql', [
'content-type' => 'application/json',
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
'origin' => 'http://localhost',
], $graphQLPayload);
$this->assertIsArray($response['body'][0]['data']);
$this->assertIsArray($response['body'][1]['data']);
@ -299,10 +303,11 @@ class BatchTest extends Scope
],
];
$response = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
$response = $this->client->call(Client::METHOD_POST, '/graphql', [
'content-type' => 'application/json',
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
'origin' => 'http://localhost',
], $graphQLPayload);
$this->assertIsArray($response['body']['data']);
@ -368,10 +373,11 @@ class BatchTest extends Scope
],
];
$response = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
$response = $this->client->call(Client::METHOD_POST, '/graphql', [
'content-type' => 'application/json',
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
'origin' => 'http://localhost',
], $graphQLPayload);
$this->assertIsArray($response['body']['data']);
$this->assertArrayNotHasKey('errors', $response['body']);