From 0409dd5c32c26bdcde7596edea45153a97d8892c Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 31 May 2021 11:35:52 +0545 Subject: [PATCH] added test for verification update --- tests/e2e/Services/Users/UsersBase.php | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/e2e/Services/Users/UsersBase.php b/tests/e2e/Services/Users/UsersBase.php index ebefa2abb9..be64204749 100644 --- a/tests/e2e/Services/Users/UsersBase.php +++ b/tests/e2e/Services/Users/UsersBase.php @@ -122,6 +122,35 @@ trait UsersBase return $data; } + /** + * @depends testGetUser + */ + public function testUpdateEmailVerification(array $data):array + { + /** + * Test for SUCCESS + */ + $user = $this->client->call(Client::METHOD_PATCH, '/users/' . $data['userId'] . '/verification', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'emailVerification' => true, + ]); + + $this->assertEquals($user['headers']['status-code'], 200); + $this->assertEquals($user['body']['emailVerification'], true); + + $user = $this->client->call(Client::METHOD_GET, '/users/' . $data['userId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals($user['headers']['status-code'], 200); + $this->assertEquals($user['body']['emailVerification'], true); + + return $data; + } + /** * @depends testGetUser */