mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
User test updates for 0.15
This commit is contained in:
@@ -84,7 +84,7 @@ trait GraphQLBase
|
||||
public static string $UPDATE_USER_NAME = 'update_user_name';
|
||||
public static string $UPDATE_USER_EMAIL = 'update_user_email';
|
||||
public static string $UPDATE_USER_EMAIL_VERIFICATION = 'update_email_verification';
|
||||
public static string $UPDATE_USER_PHONE_VERIFICATION = 'update_email_verification';
|
||||
public static string $UPDATE_USER_PHONE_VERIFICATION = 'update_phone_verification';
|
||||
public static string $UPDATE_USER_PASSWORD = 'update_user_password';
|
||||
public static string $UPDATE_USER_PHONE = 'update_user_phone';
|
||||
public static string $UPDATE_USER_PREFS = 'update_user_prefs';
|
||||
@@ -488,6 +488,7 @@ trait GraphQLBase
|
||||
case self::$UPDATE_USER_PHONE_VERIFICATION:
|
||||
return 'mutation updateUserPhoneVerification($userId: String!, $phoneVerification: Boolean!){
|
||||
usersUpdatePhoneVerification(userId: $userId, phoneVerification: $phoneVerification) {
|
||||
_id
|
||||
name
|
||||
email
|
||||
}
|
||||
@@ -725,8 +726,8 @@ trait GraphQLBase
|
||||
}
|
||||
}';
|
||||
case self::$UPDATE_PHONE_VERIFICATION:
|
||||
return 'mutation confirmPhoneVerification($userId: String!, $secret: String!) {
|
||||
accountUpdatePhoneVerification(userId: $userId, secret: $secret) {
|
||||
return 'mutation confirmPhoneVerification($userId: String!, $phoneVerification: Boolean!) {
|
||||
accountUpdatePhoneVerification(userId: $userId, phoneVerification: $phoneVerification) {
|
||||
userId
|
||||
secret
|
||||
expire
|
||||
|
||||
@@ -214,31 +214,31 @@ class GraphQLUsersTest extends Scope
|
||||
|
||||
$this->assertIsArray($user['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $user['body']);
|
||||
$this->assertIsArray($user['body']['data']['usersUpdateVerification']);
|
||||
$this->assertIsArray($user['body']['data']['usersUpdateEmailVerification']);
|
||||
}
|
||||
|
||||
// public function testUpdateUserPhoneVerification()
|
||||
// {
|
||||
// $projectId = $this->getProject()['$id'];
|
||||
// $query = $this->getQuery(self::$UPDATE_USER_PHONE_VERIFICATION);
|
||||
// $graphQLPayload = [
|
||||
// 'query' => $query,
|
||||
// 'variables' => [
|
||||
// 'userId' => $this->getUser()['$id'],
|
||||
// 'phoneVerification' => true,
|
||||
// ]
|
||||
// ];
|
||||
//
|
||||
// $user = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
// 'content-type' => 'application/json',
|
||||
// 'x-appwrite-project' => $projectId,
|
||||
// ], $this->getHeaders()), $graphQLPayload);
|
||||
//
|
||||
// $this->assertIsArray($user['body']['data']);
|
||||
// $this->assertArrayNotHasKey('errors', $user['body']);
|
||||
// $this->assertIsArray($user['body']['data']['usersUpdatePhoneVerification']);
|
||||
// $this->assertEquals($this->getUser()['$id'], $user['body']['data']['usersUpdatePhoneVerification']['_id']);
|
||||
// }
|
||||
public function testUpdateUserPhoneVerification()
|
||||
{
|
||||
$projectId = $this->getProject()['$id'];
|
||||
$query = $this->getQuery(self::$UPDATE_USER_PHONE_VERIFICATION);
|
||||
$graphQLPayload = [
|
||||
'query' => $query,
|
||||
'variables' => [
|
||||
'userId' => $this->getUser()['$id'],
|
||||
'phoneVerification' => true,
|
||||
]
|
||||
];
|
||||
|
||||
$user = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertIsArray($user['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $user['body']);
|
||||
$this->assertIsArray($user['body']['data']['usersUpdatePhoneVerification']);
|
||||
$this->assertEquals($this->getUser()['$id'], $user['body']['data']['usersUpdatePhoneVerification']['_id']);
|
||||
}
|
||||
|
||||
public function testUpdateUserName()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user