Skip to content

Commit d52925c

Browse files
committed
Fix LostController test
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent 19c1587 commit d52925c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tests/Core/Controller/LostControllerTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use OC\Authentication\TwoFactorAuth\Manager;
2525
use OC\Core\Controller\LostController;
2626
use OC\Mail\Message;
27+
use OC\Security\RateLimiting\Limiter;
2728
use OCP\AppFramework\Http\JSONResponse;
2829
use OCP\AppFramework\Http\TemplateResponse;
2930
use OCP\Defaults;
@@ -41,6 +42,7 @@
4142
use OCP\Mail\IMailer;
4243
use OCP\Security\VerificationToken\InvalidTokenException;
4344
use OCP\Security\VerificationToken\IVerificationToken;
45+
use PHPUnit\Framework\MockObject\MockObject;
4446

4547
/**
4648
* Class LostControllerTest
@@ -77,6 +79,8 @@ class LostControllerTest extends \Test\TestCase {
7779
private $initialStateService;
7880
/** @var IVerificationToken|\PHPUnit\Framework\MockObject\MockObject */
7981
private $verificationToken;
82+
/** @var Limiter|MockObject */
83+
private $limiter;
8084

8185
protected function setUp(): void {
8286
parent::setUp();
@@ -129,6 +133,7 @@ protected function setUp(): void {
129133
$this->twofactorManager = $this->createMock(Manager::class);
130134
$this->initialStateService = $this->createMock(IInitialStateService::class);
131135
$this->verificationToken = $this->createMock(IVerificationToken::class);
136+
$this->limiter = $this->createMock(Limiter::class);
132137
$this->lostController = new LostController(
133138
'Core',
134139
$this->request,
@@ -143,7 +148,8 @@ protected function setUp(): void {
143148
$this->logger,
144149
$this->twofactorManager,
145150
$this->initialStateService,
146-
$this->verificationToken
151+
$this->verificationToken,
152+
$this->limiter
147153
);
148154
}
149155

0 commit comments

Comments
 (0)