summaryrefslogtreecommitdiffstats
path: root/apps/settings
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2023-01-03 14:32:31 +0100
committerGitHub <noreply@github.com>2023-01-03 14:32:31 +0100
commit06da8adcd309952b7b83ebfaa88c7259a41cd2ed (patch)
tree47f1a69fe4f452098bfa62689bad43a7604a7a69 /apps/settings
parent4e877b7ff1977389a67cafd6f028f40f83bc91b3 (diff)
parenta7740c0ae67490aba55e9a05fcb09e7049818341 (diff)
downloadnextcloud-server-06da8adcd309952b7b83ebfaa88c7259a41cd2ed.tar.gz
nextcloud-server-06da8adcd309952b7b83ebfaa88c7259a41cd2ed.zip
Merge pull request #35943 from nextcloud/fix/code-fixes-from-34997
Code fixes from PR 34997
Diffstat (limited to 'apps/settings')
-rw-r--r--apps/settings/tests/Controller/UsersControllerTest.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/settings/tests/Controller/UsersControllerTest.php b/apps/settings/tests/Controller/UsersControllerTest.php
index e90f34d3efd..6f0bf012889 100644
--- a/apps/settings/tests/Controller/UsersControllerTest.php
+++ b/apps/settings/tests/Controller/UsersControllerTest.php
@@ -635,8 +635,8 @@ class UsersControllerTest extends \Test\TestCase {
* @dataProvider dataTestSaveUserSettings
*
* @param array $data
- * @param string $oldEmailAddress
- * @param string $oldDisplayName
+ * @param ?string $oldEmailAddress
+ * @param ?string $oldDisplayName
*/
public function testSaveUserSettings($data,
$oldEmailAddress,
@@ -649,16 +649,14 @@ class UsersControllerTest extends \Test\TestCase {
$user->method('getSystemEMailAddress')->willReturn($oldEmailAddress);
$user->method('canChangeDisplayName')->willReturn(true);
- if (strtolower($data[IAccountManager::PROPERTY_EMAIL]['value']) === strtolower($oldEmailAddress) ||
- ($oldEmailAddress === null && $data[IAccountManager::PROPERTY_EMAIL]['value'] === '')) {
+ if (strtolower($data[IAccountManager::PROPERTY_EMAIL]['value']) === strtolower($oldEmailAddress ?? '')) {
$user->expects($this->never())->method('setSystemEMailAddress');
} else {
$user->expects($this->once())->method('setSystemEMailAddress')
->with($data[IAccountManager::PROPERTY_EMAIL]['value']);
}
- if ($data[IAccountManager::PROPERTY_DISPLAYNAME]['value'] === $oldDisplayName ||
- ($oldDisplayName === null && $data[IAccountManager::PROPERTY_DISPLAYNAME]['value'] === '')) {
+ if ($data[IAccountManager::PROPERTY_DISPLAYNAME]['value'] === $oldDisplayName ?? '') {
$user->expects($this->never())->method('setDisplayName');
} else {
$user->expects($this->once())->method('setDisplayName')