diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-12-19 15:06:20 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-01-02 15:13:00 +0100 |
commit | b843d098107792d77c15610f8fce510b2d719262 (patch) | |
tree | 7d1c5855c03ef11f6b1d339005cdbcfcf52c3c79 /apps/settings | |
parent | 61895e9c79fba36eddfbbc319bdb39661844ad8b (diff) | |
download | nextcloud-server-b843d098107792d77c15610f8fce510b2d719262.tar.gz nextcloud-server-b843d098107792d77c15610f8fce510b2d719262.zip |
Fix typing errors in settings tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/settings')
-rw-r--r-- | apps/settings/tests/Controller/UsersControllerTest.php | 10 |
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') |