|
|
|
@ -23,6 +23,7 @@ use OCP\Accounts\IAccountPropertyCollection; |
|
|
|
use OCP\App\IAppManager; |
|
|
|
use OCP\AppFramework\Http\DataResponse; |
|
|
|
use OCP\AppFramework\OCS\OCSException; |
|
|
|
use OCP\Config\IUserConfig; |
|
|
|
use OCP\EventDispatcher\IEventDispatcher; |
|
|
|
use OCP\Files\IRootFolder; |
|
|
|
use OCP\Group\ISubAdmin; |
|
|
|
@ -66,6 +67,7 @@ class UsersControllerTest extends TestCase { |
|
|
|
private IRootFolder $rootFolder; |
|
|
|
private IPhoneNumberUtil $phoneNumberUtil; |
|
|
|
private IAppManager $appManager; |
|
|
|
private IUserConfig $userConfig; |
|
|
|
|
|
|
|
protected function setUp(): void { |
|
|
|
parent::setUp(); |
|
|
|
@ -88,6 +90,7 @@ class UsersControllerTest extends TestCase { |
|
|
|
$this->phoneNumberUtil = new PhoneNumberUtil(); |
|
|
|
$this->appManager = $this->createMock(IAppManager::class); |
|
|
|
$this->rootFolder = $this->createMock(IRootFolder::class); |
|
|
|
$this->userConfig = $this->createMock(IUserConfig::class); |
|
|
|
|
|
|
|
$l10n = $this->createMock(IL10N::class); |
|
|
|
$l10n->method('t')->willReturnCallback(fn (string $txt, array $replacement = []) => sprintf($txt, ...$replacement)); |
|
|
|
@ -114,6 +117,7 @@ class UsersControllerTest extends TestCase { |
|
|
|
$this->eventDispatcher, |
|
|
|
$this->phoneNumberUtil, |
|
|
|
$this->appManager, |
|
|
|
$this->userConfig, |
|
|
|
]) |
|
|
|
->onlyMethods(['fillStorageInfo']) |
|
|
|
->getMock(); |
|
|
|
@ -506,6 +510,7 @@ class UsersControllerTest extends TestCase { |
|
|
|
$this->eventDispatcher, |
|
|
|
$this->phoneNumberUtil, |
|
|
|
$this->appManager, |
|
|
|
$this->userConfig, |
|
|
|
]) |
|
|
|
->onlyMethods(['editUser']) |
|
|
|
->getMock(); |
|
|
|
@ -2291,8 +2296,8 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UserToEdit'); |
|
|
|
$targetUser = $this->createMock(IUser::class); |
|
|
|
$this->config->expects($this->once()) |
|
|
|
->method('setUserValue') |
|
|
|
$this->userConfig->expects($this->once()) |
|
|
|
->method('setValueString') |
|
|
|
->with('UserToEdit', 'core', 'lang', 'de'); |
|
|
|
$this->userSession |
|
|
|
->expects($this->once()) |
|
|
|
@ -2346,8 +2351,8 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('UserToEdit'); |
|
|
|
$targetUser = $this->createMock(IUser::class); |
|
|
|
$this->config->expects($this->never()) |
|
|
|
->method('setUserValue'); |
|
|
|
$this->userConfig->expects($this->never()) |
|
|
|
->method('setValueString'); |
|
|
|
$this->userSession |
|
|
|
->expects($this->once()) |
|
|
|
->method('getUser') |
|
|
|
@ -2387,8 +2392,8 @@ class UsersControllerTest extends TestCase { |
|
|
|
->method('getUID') |
|
|
|
->willReturn('admin'); |
|
|
|
$targetUser = $this->createMock(IUser::class); |
|
|
|
$this->config->expects($this->once()) |
|
|
|
->method('setUserValue') |
|
|
|
$this->userConfig->expects($this->once()) |
|
|
|
->method('setValueString') |
|
|
|
->with('UserToEdit', 'core', 'lang', 'de'); |
|
|
|
$this->userSession |
|
|
|
->expects($this->once()) |
|
|
|
@ -3850,6 +3855,7 @@ class UsersControllerTest extends TestCase { |
|
|
|
$this->eventDispatcher, |
|
|
|
$this->phoneNumberUtil, |
|
|
|
$this->appManager, |
|
|
|
$this->userConfig, |
|
|
|
]) |
|
|
|
->onlyMethods(['getUserData']) |
|
|
|
->getMock(); |
|
|
|
@ -3944,6 +3950,7 @@ class UsersControllerTest extends TestCase { |
|
|
|
$this->eventDispatcher, |
|
|
|
$this->phoneNumberUtil, |
|
|
|
$this->appManager, |
|
|
|
$this->userConfig, |
|
|
|
]) |
|
|
|
->onlyMethods(['getUserData']) |
|
|
|
->getMock(); |
|
|
|
|