summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-06-06 08:06:39 -0500
committerGitHub <noreply@github.com>2017-06-06 08:06:39 -0500
commit15314b6f5b7914a72ca1b424a13ecd82163a8f14 (patch)
tree660f8dfd14a102da7b54e34d2c3c4fb47791fcf0 /tests
parent811f7b527a9f84895222425949084d52a250f8d9 (diff)
parentf39fdaf46e6ab9b3840102bb657cce7d0b074e6f (diff)
downloadnextcloud-server-15314b6f5b7914a72ca1b424a13ecd82163a8f14.tar.gz
nextcloud-server-15314b6f5b7914a72ca1b424a13ecd82163a8f14.zip
Merge pull request #5223 from nextcloud/do-not-allow-to-set-invisible-fields
Don't allow the user to set fields they can't see
Diffstat (limited to 'tests')
-rw-r--r--tests/Settings/Controller/UsersControllerTest.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/Settings/Controller/UsersControllerTest.php b/tests/Settings/Controller/UsersControllerTest.php
index 5905023e960..7186ce7bebd 100644
--- a/tests/Settings/Controller/UsersControllerTest.php
+++ b/tests/Settings/Controller/UsersControllerTest.php
@@ -2005,6 +2005,52 @@ class UsersControllerTest extends \Test\TestCase {
$saveData = (!empty($email) && $validEmail) || empty($email);
if ($saveData) {
+ $this->accountManager->expects($this->once())
+ ->method('getUser')
+ ->with($user)
+ ->willReturn([
+ AccountManager::PROPERTY_DISPLAYNAME =>
+ [
+ 'value' => 'Display name',
+ 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY,
+ 'verified' => AccountManager::NOT_VERIFIED,
+ ],
+ AccountManager::PROPERTY_ADDRESS =>
+ [
+ 'value' => '',
+ 'scope' => AccountManager::VISIBILITY_PRIVATE,
+ 'verified' => AccountManager::NOT_VERIFIED,
+ ],
+ AccountManager::PROPERTY_WEBSITE =>
+ [
+ 'value' => '',
+ 'scope' => AccountManager::VISIBILITY_PRIVATE,
+ 'verified' => AccountManager::NOT_VERIFIED,
+ ],
+ AccountManager::PROPERTY_EMAIL =>
+ [
+ 'value' => '',
+ 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY,
+ 'verified' => AccountManager::NOT_VERIFIED,
+ ],
+ AccountManager::PROPERTY_AVATAR =>
+ [
+ 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY
+ ],
+ AccountManager::PROPERTY_PHONE =>
+ [
+ 'value' => '',
+ 'scope' => AccountManager::VISIBILITY_PRIVATE,
+ 'verified' => AccountManager::NOT_VERIFIED,
+ ],
+ AccountManager::PROPERTY_TWITTER =>
+ [
+ 'value' => '',
+ 'scope' => AccountManager::VISIBILITY_PRIVATE,
+ 'verified' => AccountManager::NOT_VERIFIED,
+ ],
+ ]);
+
$controller->expects($this->once())->method('saveUserSettings');
} else {
$controller->expects($this->never())->method('saveUserSettings');