mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Add unit test for case insensitive email saving
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
This commit is contained in:
parent
b813d05272
commit
bf4f0d37f8
1 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||
],
|
||||
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue