aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-11-28 11:58:02 +0100
committerGitHub <noreply@github.com>2024-11-28 11:58:02 +0100
commit379f575c25cdf4769d5c019394e73ac8b8f46385 (patch)
treebbc5264a7e54ad277772c36e445a9075fe857570 /tests
parent871dc78b3395c9b7d518f07e4c75bd9472c7f6e9 (diff)
parentd6fa2100e1cda004dd7b0b682b7e465d9fa830fa (diff)
downloadnextcloud-server-379f575c25cdf4769d5c019394e73ac8b8f46385.tar.gz
nextcloud-server-379f575c25cdf4769d5c019394e73ac8b8f46385.zip
Merge pull request #49493 from nextcloud/artonge/feat/pwd_confirmation_allow_set_period
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php
index 148335d270f..3dec030d438 100644
--- a/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php
@@ -10,6 +10,7 @@ use OC\AppFramework\Middleware\Security\Exceptions\NotConfirmedException;
use OC\AppFramework\Middleware\Security\PasswordConfirmationMiddleware;
use OC\AppFramework\Utility\ControllerMethodReflector;
use OC\Authentication\Token\IProvider;
+use OC\User\Manager;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Authentication\Token\IToken;
use OCP\IRequest;
@@ -23,20 +24,24 @@ use Test\TestCase;
class PasswordConfirmationMiddlewareTest extends TestCase {
/** @var ControllerMethodReflector */
private $reflector;
- /** @var ISession|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var ISession&\PHPUnit\Framework\MockObject\MockObject */
private $session;
- /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IUserSession&\PHPUnit\Framework\MockObject\MockObject */
private $userSession;
- /** @var IUser|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IUser&\PHPUnit\Framework\MockObject\MockObject */
private $user;
/** @var PasswordConfirmationMiddleware */
private $middleware;
/** @var PasswordConfirmationMiddlewareController */
private $controller;
- /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var ITimeFactory&\PHPUnit\Framework\MockObject\MockObject */
private $timeFactory;
- private IProvider|\PHPUnit\Framework\MockObject\MockObject $tokenProvider;
+ private IProvider&\PHPUnit\Framework\MockObject\MockObject $tokenProvider;
private LoggerInterface $logger;
+ /** @var IRequest&\PHPUnit\Framework\MockObject\MockObject */
+ private IRequest $request;
+ /** @var Manager&\PHPUnit\Framework\MockObject\MockObject */
+ private Manager $userManager;
protected function setUp(): void {
$this->reflector = new ControllerMethodReflector();
@@ -46,6 +51,8 @@ class PasswordConfirmationMiddlewareTest extends TestCase {
$this->timeFactory = $this->createMock(ITimeFactory::class);
$this->tokenProvider = $this->createMock(IProvider::class);
$this->logger = $this->createMock(LoggerInterface::class);
+ $this->request = $this->createMock(IRequest::class);
+ $this->userManager = $this->createMock(Manager::class);
$this->controller = new PasswordConfirmationMiddlewareController(
'test',
$this->createMock(IRequest::class)
@@ -58,6 +65,8 @@ class PasswordConfirmationMiddlewareTest extends TestCase {
$this->timeFactory,
$this->tokenProvider,
$this->logger,
+ $this->request,
+ $this->userManager,
);
}