1
0
Fork 0
mirror of synced 2024-07-12 18:05:55 +12:00

Add tests

This commit is contained in:
Piotr Rogowski 2022-10-15 16:40:07 +02:00
parent 833e3f8ce1
commit b65a8c86c5
No known key found for this signature in database
GPG key ID: 4A842D702D9C6F8F

View file

@ -644,6 +644,19 @@ trait UsersBase
$this->assertIsInt($users['body']['total']);
$this->assertGreaterThan(0, $users['body']['total']);
/**
* Test for FAILURE
*/
$user = $this->client->call(Client::METHOD_GET, '/users/non_existent', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()));
$this->assertEquals($user['headers']['status-code'], 404);
$this->assertEquals($user['body']['code'], 404);
$this->assertEquals($user['body']['message'], 'User with the requested ID could not be found.');
$this->assertEquals($user['body']['type'], 'user_not_found');
return $data;
}