added test for verification update

This commit is contained in:
Damodar Lohani committed 2021-05-31 11:35:52 +05:45
1 parent 20e4745786
commit 0409dd5c32
1 file changed
+29
+29
View File
@@ -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
*/