summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-12-16 17:47:18 +0100
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-12-16 21:52:16 +0000
commitbf4f0d37f8bb3bb24f38bceb524705de54ebe137 (patch)
tree2415728459ae9134dc2867cf6a27fe7fc4b96786
parentb813d05272c243d702025070ad039a5c9932bdef (diff)
downloadnextcloud-server-bf4f0d37f8bb3bb24f38bceb524705de54ebe137.tar.gz
nextcloud-server-bf4f0d37f8bb3bb24f38bceb524705de54ebe137.zip
Add unit test for case insensitive email saving
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
-rw-r--r--apps/settings/tests/Controller/UsersControllerTest.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/settings/tests/Controller/UsersControllerTest.php b/apps/settings/tests/Controller/UsersControllerTest.php
index 797fa1621fa..ba7d9689130 100644
--- a/apps/settings/tests/Controller/UsersControllerTest.php
+++ b/apps/settings/tests/Controller/UsersControllerTest.php
@@ -624,7 +624,7 @@ class UsersControllerTest extends \Test\TestCase {
$user->method('getSystemEMailAddress')->willReturn($oldEmailAddress);
$user->method('canChangeDisplayName')->willReturn(true);
- if ($data[IAccountManager::PROPERTY_EMAIL]['value'] === $oldEmailAddress ||
+ if (strtolower($data[IAccountManager::PROPERTY_EMAIL]['value']) === strtolower($oldEmailAddress) ||
($oldEmailAddress === null && $data[IAccountManager::PROPERTY_EMAIL]['value'] === '')) {
$user->expects($this->never())->method('setSystemEMailAddress');
} else {
@@ -720,6 +720,14 @@ class UsersControllerTest extends \Test\TestCase {
'john@example.com',
null
],
+ [
+ [
+ IAccountManager::PROPERTY_EMAIL => ['value' => 'john@example.com'],
+ IAccountManager::PROPERTY_DISPLAYNAME => ['value' => 'john doe'],
+ ],
+ 'JOHN@example.com',
+ null
+ ],
];
}