|
|
|
@ -66,7 +66,6 @@ use OCP\L10N\IFactory; |
|
|
|
use OCP\Mail\IEMailTemplate; |
|
|
|
use OCP\Security\Events\GenerateSecurePasswordEvent; |
|
|
|
use OCP\Security\ISecureRandom; |
|
|
|
use OCP\User\Backend\IGetDisplayNameBackend; |
|
|
|
use OCP\User\Backend\ISetDisplayNameBackend; |
|
|
|
use OCP\UserInterface; |
|
|
|
use PHPUnit\Framework\MockObject\MockObject; |
|
|
|
@ -1491,6 +1490,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UID'); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$targetUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->assertEquals([], $this->api->editUser('UserToEdit', 'email', 'demo@nextcloud.com')->getData()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1524,6 +1529,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UID'); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$targetUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->api->editUser('UserToEdit', 'email', 'demo.org'); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1557,6 +1568,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->with('UserToEdit') |
|
|
|
->willReturn($loggedInUser); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$loggedInUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->accountManager->expects($this->once()) |
|
|
|
->method('getUser') |
|
|
|
->with($loggedInUser) |
|
|
|
@ -1601,6 +1618,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->with('UserToEdit') |
|
|
|
->willReturn($loggedInUser); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$loggedInUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->accountManager->expects($this->once()) |
|
|
|
->method('getUser') |
|
|
|
->with($loggedInUser) |
|
|
|
@ -1645,6 +1668,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UID'); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$targetUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->assertEquals([], $this->api->editUser('UserToEdit', 'password', 'NewPassword')->getData()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1678,6 +1707,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UID'); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$targetUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->api->editUser('UserToEdit', 'quota', 'NewQuota'); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1710,6 +1745,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UID'); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$targetUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->assertEquals([], $this->api->editUser('UserToEdit', 'quota', '3042824')->getData()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1745,6 +1786,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UID'); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$targetUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->api->editUser('UserToEdit', 'quota', 'ABC'); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1784,6 +1831,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UID'); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$targetUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->assertEquals([], $this->api->editUser('UserToEdit', 'quota', '3042824')->getData()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1826,6 +1879,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UserToEdit'); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$targetUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->assertEquals([], $this->api->editUser('UserToEdit', 'language', 'de')->getData()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1876,6 +1935,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UserToEdit'); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$targetUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->assertEquals([], $this->api->editUser('UserToEdit', 'language', 'de')->getData()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1917,6 +1982,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UserToEdit'); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$targetUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->assertEquals([], $this->api->editUser('UserToEdit', 'language', 'de')->getData()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1963,6 +2034,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UserToEdit'); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$targetUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->assertEquals([], $this->api->editUser('UserToEdit', 'language', 'ru')->getData()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -2002,6 +2079,12 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UID'); |
|
|
|
|
|
|
|
$backend = $this->createMock(UserInterface::class); |
|
|
|
$targetUser |
|
|
|
->expects($this->any()) |
|
|
|
->method('getBackend') |
|
|
|
->willReturn($backend); |
|
|
|
|
|
|
|
$this->assertEquals([], $this->api->editUser('UserToEdit', 'quota', '3042824')->getData()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -3737,7 +3820,7 @@ class UsersControllerTest extends TestCase { |
|
|
|
IAccountManager::PROPERTY_WEBSITE, |
|
|
|
IAccountManager::PROPERTY_TWITTER, |
|
|
|
]], |
|
|
|
[true, IGetDisplayNameBackend::class, [ |
|
|
|
[true, UserInterface::class, [ |
|
|
|
IAccountManager::PROPERTY_EMAIL, |
|
|
|
IAccountManager::PROPERTY_PHONE, |
|
|
|
IAccountManager::PROPERTY_ADDRESS, |
|
|
|
|