Skip to content

Commit

Permalink
test:(PasswordConfirmationMiddleware): Fix constructor call
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed Nov 27, 2024
1 parent bb6364d commit 728b6ec
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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;
Expand All @@ -23,20 +24,24 @@
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();
Expand All @@ -46,6 +51,8 @@ protected function setUp(): void {
$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)
Expand All @@ -58,6 +65,8 @@ protected function setUp(): void {
$this->timeFactory,
$this->tokenProvider,
$this->logger,
$this->request,
$this->userManager,
);
}

Expand Down

0 comments on commit 728b6ec

Please sign in to comment.