diff options
author | Joas Schilling <coding@schilljs.com> | 2020-06-23 08:45:01 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-07-03 10:59:43 +0200 |
commit | db8267db26e2e81ef4a39b424c5a8ea7bc124bfd (patch) | |
tree | 0d63e8dd40150166639f84083bfaf37cd9c52077 /apps/provisioning_api/tests/Controller/UsersControllerTest.php | |
parent | b997edad105d38703351b89998444ab0828f7d05 (diff) | |
download | nextcloud-server-db8267db26e2e81ef4a39b424c5a8ea7bc124bfd.tar.gz nextcloud-server-db8267db26e2e81ef4a39b424c5a8ea7bc124bfd.zip |
Use the new method everywhere
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/provisioning_api/tests/Controller/UsersControllerTest.php')
-rw-r--r-- | apps/provisioning_api/tests/Controller/UsersControllerTest.php | 57 |
1 files changed, 20 insertions, 37 deletions
diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php index afd7304622b..f001611cebe 100644 --- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php +++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php @@ -953,16 +953,6 @@ class UsersControllerTest extends TestCase { ->method('getUserValue') ->with('UID', 'core', 'enabled', 'true') ->willReturn('true'); - $this->config - ->expects($this->at(1)) - ->method('getUserValue') - ->with('UID', 'core', 'lang') - ->willReturn('de'); - $this->config - ->expects($this->once()) - ->method('getSystemValue') - ->with('force_language', 'de') - ->willReturn('de'); $this->api ->expects($this->once()) ->method('fillStorageInfo') @@ -995,10 +985,15 @@ class UsersControllerTest extends TestCase { ->method('getBackend') ->willReturn($backend); $targetUser - ->expects($this->exactly(6)) ->method('getUID') ->willReturn('UID'); + $this->l10nFactory + ->expects($this->once()) + ->method('getUserLanguage') + ->with($targetUser) + ->willReturn('de'); + $expected = [ 'id' => 'UID', 'enabled' => true, @@ -1078,16 +1073,6 @@ class UsersControllerTest extends TestCase { ->method('getUserValue') ->with('UID', 'core', 'enabled', 'true') ->willReturn('true'); - $this->config - ->expects($this->once()) - ->method('getSystemValue') - ->with('force_language', 'da') - ->willReturn('da'); - $this->config - ->expects($this->at(1)) - ->method('getUserValue') - ->with('UID', 'core', 'lang') - ->willReturn('da'); $this->api ->expects($this->once()) ->method('fillStorageInfo') @@ -1120,7 +1105,6 @@ class UsersControllerTest extends TestCase { ->method('getBackend') ->willReturn($backend); $targetUser - ->expects($this->exactly(6)) ->method('getUID') ->willReturn('UID'); $this->accountManager->expects($this->any())->method('getUser') @@ -1134,6 +1118,12 @@ class UsersControllerTest extends TestCase { ] ); + $this->l10nFactory + ->expects($this->once()) + ->method('getUserLanguage') + ->with($targetUser) + ->willReturn('da'); + $expected = [ 'id' => 'UID', 'enabled' => true, @@ -1255,11 +1245,6 @@ class UsersControllerTest extends TestCase { ->method('fillStorageInfo') ->with('UID') ->willReturn(['DummyValue']); - $this->config - ->expects($this->once()) - ->method('getSystemValue') - ->with('force_language', 'ru') - ->willReturn('ru'); $backend = $this->createMock(UserInterface::class); $backend->expects($this->atLeastOnce()) @@ -1275,7 +1260,6 @@ class UsersControllerTest extends TestCase { ->method('getEMailAddress') ->willReturn('subadmin@nextcloud.com'); $targetUser - ->expects($this->exactly(6)) ->method('getUID') ->willReturn('UID'); $targetUser @@ -1294,11 +1278,6 @@ class UsersControllerTest extends TestCase { ->expects($this->once()) ->method('getBackend') ->willReturn($backend); - $this->config - ->expects($this->at(0)) - ->method('getUserValue') - ->with('UID', 'core', 'lang') - ->willReturn('ru'); $this->accountManager->expects($this->any())->method('getUser') ->with($targetUser) ->willReturn( @@ -1310,6 +1289,12 @@ class UsersControllerTest extends TestCase { ] ); + $this->l10nFactory + ->expects($this->once()) + ->method('getUserLanguage') + ->with($targetUser) + ->willReturn('ru'); + $expected = [ 'id' => 'UID', 'storageLocation' => '/var/www/newtcloud/data/UID', @@ -2911,8 +2896,7 @@ class UsersControllerTest extends TestCase { $subAdminManager ->expects($this->once()) ->method('createSubAdmin') - ->with($targetUser, $targetGroup) - ->willReturn(true); + ->with($targetUser, $targetGroup); $this->groupManager ->expects($this->once()) ->method('getSubAdmin') @@ -3014,8 +2998,7 @@ class UsersControllerTest extends TestCase { $subAdminManager ->expects($this->once()) ->method('deleteSubAdmin') - ->with($targetUser, $targetGroup) - ->willReturn(true); + ->with($targetUser, $targetGroup); $this->groupManager ->expects($this->once()) ->method('getSubAdmin') |