1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00

Merge pull request #811 from appwrite/fix-user-prefs-ui

Fix user prefs UI
This commit is contained in:
Eldad A. Fux 2021-01-11 13:09:18 +02:00 committed by GitHub
commit e7cdb3f271
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,12 +125,12 @@ trait UsersBase
/**
* @depends testGetUser
*/
public function testUpdateUserPrefs(array $data):array
public function testUpdateAndGetUserPrefs(array $data):array
{
/**
* Test for SUCCESS
*/
$user = $this->client->call(Client::METHOD_PATCH, '/users/' . $data['userId'] . '/prefs', array_merge([
$user = $this->client->call(Client::METHOD_PATCH, '/users/'.$data['userId'].'/prefs', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
@ -144,6 +144,17 @@ trait UsersBase
$this->assertEquals($user['body']['funcKey1'], 'funcValue1');
$this->assertEquals($user['body']['funcKey2'], 'funcValue2');
$user = $this->client->call(Client::METHOD_GET, '/users/'.$data['userId'].'/prefs', 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'], [
'funcKey1' => 'funcValue1',
'funcKey2' => 'funcValue2',
]);
/**
* Test for FAILURE
*/