From 0b1b21a5b00c0f9b6fc9c1558d7afc1ec22111aa Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 23 Jun 2021 16:06:52 +0100 Subject: [PATCH] Update Tests --- tests/e2e/Services/Account/AccountBase.php | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 46b9f127d..18a6ee4d9 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -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;