mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Add unit test for case insensitive email saving
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
This commit is contained in:
parent
7f44a66296
commit
f9ea078e27
1 changed files with 9 additions and 1 deletions
|
|
@ -649,7 +649,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 {
|
||||
|
|
@ -745,6 +745,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
|
||||
],
|
||||
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue