]> source.dussan.org Git - nextcloud-server.git/commitdiff
move mocks into private variables 36033/head
authorArtur Neumann <artur@jankaritech.com>
Mon, 9 Jan 2023 07:01:10 +0000 (12:46 +0545)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 14 Mar 2023 16:18:56 +0000 (17:18 +0100)
Signed-off-by: Artur Neumann <artur@jankaritech.com>
apps/oauth2/tests/Controller/SettingsControllerTest.php

index b11c59fd414920ff24153e5d4bb6d75eb674d2b2..e79d7cbe34ef1648bea27d430e1dd6f60ad3f8ef 100644 (file)
@@ -53,6 +53,10 @@ class SettingsControllerTest extends TestCase {
        private $secureRandom;
        /** @var AccessTokenMapper|\PHPUnit\Framework\MockObject\MockObject */
        private $accessTokenMapper;
+       /** @var IAuthTokenProvider|\PHPUnit\Framework\MockObject\MockObject */
+       private $authTokenProvider;
+       /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
+       private $userManager;
        /** @var SettingsController */
        private $settingsController;
        /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
@@ -65,6 +69,8 @@ class SettingsControllerTest extends TestCase {
                $this->clientMapper = $this->createMock(ClientMapper::class);
                $this->secureRandom = $this->createMock(ISecureRandom::class);
                $this->accessTokenMapper = $this->createMock(AccessTokenMapper::class);
+               $this->authTokenProvider = $this->createMock(IAuthTokenProvider::class);
+               $this->userManager = $this->createMock(IUserManager::class);
                $this->l = $this->createMock(IL10N::class);
                $this->l->method('t')
                        ->willReturnArgument(0);
@@ -75,8 +81,8 @@ class SettingsControllerTest extends TestCase {
                        $this->secureRandom,
                        $this->accessTokenMapper,
                        $this->l,
-                       $this->createMock(IAuthTokenProvider::class),
-                       $this->createMock(IUserManager::class)
+                       $this->authTokenProvider,
+                       $this->userManager
                );
 
        }