UserRecoveryController example



    public function testResetRateLimtitUserRecovery(): void
    {
        $recoveryService = $this->createMock(UserRecoveryService::class);
        $userEntity = new UserEntity();
        $userEntity->setUsername('admin');
        $userEntity->setEmail('test@test.de');
        $recoveryService->method('getUserByHash')->willReturn($userEntity);
        $recoveryService->method('updatePassword')->willReturn(true);

        $controller = new UserRecoveryController(
            $recoveryService,
            $this->mockResetLimiter([
                RateLimiter::OAUTH => 1,
                RateLimiter::USER_RECOVERY => 1,
            ]),
        );

        $controller->updateUserPassword(new Request()$this->context);
    }

    public function testItThrowsExceptionOnInvalidRoute(): void
    {
Home | Imprint | This part of the site doesn't use cookies.