Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2021-01-30 00:11:16 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2021-04-23 12:44:41 +0300
commita7431817b90a8343744ebd31941d49676d108313 (patch)
treef05611cd21b35807030efc28442dad76af3c5bdf /apps/settings/tests
parentc5e3d2e5c27067112e45d3da6dcad8c53d5e8cd8 (diff)
Respect additional user settings not covered by the controller
"AccountManager::updateUser()" wipes previous user data with whichever user data is given (except for some adjustments, like resetting the verified status when needed). As the controller overrode the properties those properties would lose some of their attributes even if they are not affected by the changes made by the controller. Now the controller only modifies the attributes set ("value" and "scope") to prevent that. Note that with this change the controller no longer removes the "verified" status, but this is not a problem because, as mentioned, "AccountManager::updateUser()" resets them when needed (for example, when the value of the website property changes). This change is a previous step to fix overwritting properties with null values, and it will prevent the controller from making unexpected changes if more attributes are added in the future. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/settings/tests')
-rw-r--r--apps/settings/tests/Controller/UsersControllerTest.php10
1 files changed, 0 insertions, 10 deletions
diff --git a/apps/settings/tests/Controller/UsersControllerTest.php b/apps/settings/tests/Controller/UsersControllerTest.php
index 81592c28603..48c6fba1894 100644
--- a/apps/settings/tests/Controller/UsersControllerTest.php
+++ b/apps/settings/tests/Controller/UsersControllerTest.php
@@ -330,16 +330,12 @@ class UsersControllerTest extends \Test\TestCase {
$expectedProperties[IAccountManager::PROPERTY_AVATAR]['scope'] = $avatarScope;
$expectedProperties[IAccountManager::PROPERTY_PHONE]['value'] = $phone;
$expectedProperties[IAccountManager::PROPERTY_PHONE]['scope'] = $phoneScope;
- unset($expectedProperties[IAccountManager::PROPERTY_PHONE]['verified']);
$expectedProperties[IAccountManager::PROPERTY_WEBSITE]['value'] = $website;
$expectedProperties[IAccountManager::PROPERTY_WEBSITE]['scope'] = $websiteScope;
- unset($expectedProperties[IAccountManager::PROPERTY_WEBSITE]['verified']);
$expectedProperties[IAccountManager::PROPERTY_ADDRESS]['value'] = $address;
$expectedProperties[IAccountManager::PROPERTY_ADDRESS]['scope'] = $addressScope;
- unset($expectedProperties[IAccountManager::PROPERTY_ADDRESS]['verified']);
$expectedProperties[IAccountManager::PROPERTY_TWITTER]['value'] = $twitter;
$expectedProperties[IAccountManager::PROPERTY_TWITTER]['scope'] = $twitterScope;
- unset($expectedProperties[IAccountManager::PROPERTY_TWITTER]['verified']);
$this->mailer->expects($this->once())->method('validateMailAddress')
->willReturn(true);
@@ -405,22 +401,16 @@ class UsersControllerTest extends \Test\TestCase {
$expectedProperties[IAccountManager::PROPERTY_AVATAR]['scope'] = $avatarScope;
$expectedProperties[IAccountManager::PROPERTY_DISPLAYNAME]['value'] = $displayName;
$expectedProperties[IAccountManager::PROPERTY_DISPLAYNAME]['scope'] = $displayNameScope;
- unset($expectedProperties[IAccountManager::PROPERTY_DISPLAYNAME]['verified']);
$expectedProperties[IAccountManager::PROPERTY_EMAIL]['value'] = $email;
$expectedProperties[IAccountManager::PROPERTY_EMAIL]['scope'] = $emailScope;
- unset($expectedProperties[IAccountManager::PROPERTY_EMAIL]['verified']);
$expectedProperties[IAccountManager::PROPERTY_PHONE]['value'] = $phone;
$expectedProperties[IAccountManager::PROPERTY_PHONE]['scope'] = $phoneScope;
- unset($expectedProperties[IAccountManager::PROPERTY_PHONE]['verified']);
$expectedProperties[IAccountManager::PROPERTY_WEBSITE]['value'] = $website;
$expectedProperties[IAccountManager::PROPERTY_WEBSITE]['scope'] = $websiteScope;
- unset($expectedProperties[IAccountManager::PROPERTY_WEBSITE]['verified']);
$expectedProperties[IAccountManager::PROPERTY_ADDRESS]['value'] = $address;
$expectedProperties[IAccountManager::PROPERTY_ADDRESS]['scope'] = $addressScope;
- unset($expectedProperties[IAccountManager::PROPERTY_ADDRESS]['verified']);
$expectedProperties[IAccountManager::PROPERTY_TWITTER]['value'] = $twitter;
$expectedProperties[IAccountManager::PROPERTY_TWITTER]['scope'] = $twitterScope;
- unset($expectedProperties[IAccountManager::PROPERTY_TWITTER]['verified']);
$this->mailer->expects($this->once())->method('validateMailAddress')
->willReturn(true);