mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Add malformed request body tests
This commit is contained in:
parent
4f5c7ddada
commit
13ff5ca45e
1 changed files with 22 additions and 0 deletions
|
|
@ -118,4 +118,26 @@ class GraphQLContentTypeTest extends Scope
|
|||
$this->assertArrayNotHasKey('errors', $file['body']);
|
||||
$this->assertIsArray($file['body']['data']['storageCreateFile']);
|
||||
}
|
||||
|
||||
public function testEmptyBody()
|
||||
{
|
||||
$projectId = $this->getProject()['$id'];
|
||||
$response = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals('No query supplied.', $response['body']['message']);
|
||||
}
|
||||
|
||||
public function testRandomBody()
|
||||
{
|
||||
$projectId = $this->getProject()['$id'];
|
||||
$response = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), ['foo' => 'bar']);
|
||||
|
||||
$this->assertEquals('Invalid query.', $response['body']['message']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue