Signed-off-by: Vincent Petry <vincent@nextcloud.com>
$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 {
'john@example.com',
null
],
+ [
+ [
+ IAccountManager::PROPERTY_EMAIL => ['value' => 'john@example.com'],
+ IAccountManager::PROPERTY_DISPLAYNAME => ['value' => 'john doe'],
+ ],
+ 'JOHN@example.com',
+ null
+ ],
];
}