summaryrefslogtreecommitdiffstats
path: root/apps/oauth2
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-12-09 17:09:55 +0100
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>2025-01-07 10:34:30 +0100
commit99e0867f0aaa81ebeae43deaa8ea389419dd9aaa (patch)
treefb5d2b70d0fae896632ba1701143c8bb60ec0215 /apps/oauth2
parente7be008dc1ee9ef504448d61606b03897b33b660 (diff)
downloadnextcloud-server-99e0867f0aaa81ebeae43deaa8ea389419dd9aaa.tar.gz
nextcloud-server-99e0867f0aaa81ebeae43deaa8ea389419dd9aaa.zip
chore: Adapt tests to added constructor parameters
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/oauth2')
-rw-r--r--apps/oauth2/tests/Controller/LoginRedirectorControllerTest.php30
1 files changed, 17 insertions, 13 deletions
diff --git a/apps/oauth2/tests/Controller/LoginRedirectorControllerTest.php b/apps/oauth2/tests/Controller/LoginRedirectorControllerTest.php
index 30806854574..a2ebb676b4a 100644
--- a/apps/oauth2/tests/Controller/LoginRedirectorControllerTest.php
+++ b/apps/oauth2/tests/Controller/LoginRedirectorControllerTest.php
@@ -11,28 +11,28 @@ use OCA\OAuth2\Db\ClientMapper;
use OCA\OAuth2\Exceptions\ClientNotFoundException;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\TemplateResponse;
+use OCP\IAppConfig;
use OCP\IL10N;
use OCP\IRequest;
use OCP\ISession;
use OCP\IURLGenerator;
+use OCP\Security\ISecureRandom;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
/**
* @group DB
*/
class LoginRedirectorControllerTest extends TestCase {
- /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
- private $request;
- /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
- private $urlGenerator;
- /** @var ClientMapper|\PHPUnit\Framework\MockObject\MockObject */
- private $clientMapper;
- /** @var ISession|\PHPUnit\Framework\MockObject\MockObject */
- private $session;
- /** @var LoginRedirectorController */
- private $loginRedirectorController;
- /** @var IL10N */
- private $l;
+ private IRequest&MockObject $request;
+ private IURLGenerator&MockObject $urlGenerator;
+ private ClientMapper&MockObject $clientMapper;
+ private ISession&MockObject $session;
+ private IL10N&MockObject $l;
+ private ISecureRandom&MockObject $random;
+ private IAppConfig&MockObject $appConfig;
+
+ private LoginRedirectorController $loginRedirectorController;
protected function setUp(): void {
parent::setUp();
@@ -42,6 +42,8 @@ class LoginRedirectorControllerTest extends TestCase {
$this->clientMapper = $this->createMock(ClientMapper::class);
$this->session = $this->createMock(ISession::class);
$this->l = $this->createMock(IL10N::class);
+ $this->random = $this->createMock(ISecureRandom::class);
+ $this->appConfig = $this->createMock(IAppConfig::class);
$this->loginRedirectorController = new LoginRedirectorController(
'oauth2',
@@ -49,7 +51,9 @@ class LoginRedirectorControllerTest extends TestCase {
$this->urlGenerator,
$this->clientMapper,
$this->session,
- $this->l
+ $this->l,
+ $this->random,
+ $this->appConfig,
);
}