1
0
Fork 0
mirror of synced 2024-05-17 19:22:34 +12:00

Update Tests

This commit is contained in:
Bradley Schofield 2021-06-23 16:06:52 +01:00
parent 84f88628f5
commit 0b1b21a5b0

View file

@ -591,6 +591,29 @@ trait AccountBase
$this->assertEquals($response['headers']['status-code'], 400);
// Test if we can create a new account with the old email
/**
* Test for SUCCESS
*/
$response = $this->client->call(Client::METHOD_POST, '/account', array_merge([
'origin' => 'http://localhost',
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
]), [
'email' => $data['email'],
'password' => $data['password'],
'name' => $data['name'],
]);
$this->assertEquals($response['headers']['status-code'], 201);
$this->assertNotEmpty($response['body']);
$this->assertNotEmpty($response['body']['$id']);
$this->assertIsNumeric($response['body']['registration']);
$this->assertEquals($response['body']['email'], $data['email']);
$this->assertEquals($response['body']['name'], $data['name'],);
$data['email'] = $newEmail;
return $data;