Browse Source

Fix Authentication test

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v22.0.0beta1
Joas Schilling 3 years ago
parent
commit
4ed296db9f
No account linked to committer's email address
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      tests/lib/Authentication/TwoFactorAuth/ProviderLoaderTest.php

+ 5
- 4
tests/lib/Authentication/TwoFactorAuth/ProviderLoaderTest.php View File

use OC\Authentication\TwoFactorAuth\ProviderLoader; use OC\Authentication\TwoFactorAuth\ProviderLoader;
use OCP\App\IAppManager; use OCP\App\IAppManager;
use OCP\Authentication\TwoFactorAuth\IProvider; use OCP\Authentication\TwoFactorAuth\IProvider;
use OCP\IUser;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase; use Test\TestCase;


class ProviderLoaderTest extends TestCase { class ProviderLoaderTest extends TestCase {


/** @var IAppManager|\PHPUnit\Framework\MockObject\MockObject */
/** @var IAppManager|MockObject */
private $appManager; private $appManager;


/** @var \OCP\IUser|\PHPUnit\Framework\MockObject\MockObject */
/** @var IUser|MockObject */
private $user; private $user;


/** @var RegistrationContext|MockObject */ /** @var RegistrationContext|MockObject */
parent::setUp(); parent::setUp();


$this->appManager = $this->createMock(IAppManager::class); $this->appManager = $this->createMock(IAppManager::class);
$this->user = $this->createMock(\OCP\IUser::class);
$this->user = $this->createMock(IUser::class);


$this->registrationContext = $this->createMock(RegistrationContext::class); $this->registrationContext = $this->createMock(RegistrationContext::class);
$coordinator = $this->createMock(Coordinator::class); $coordinator = $this->createMock(Coordinator::class);
->with($this->user) ->with($this->user)
->willReturn([]); ->willReturn([]);


$this->registrationContext->method('getTwoFactorProvider')
$this->registrationContext->method('getTwoFactorProviders')
->willReturn([ ->willReturn([
new ServiceRegistration('twofactor_test', '\\OCA\\TwoFactorTest\\Provider') new ServiceRegistration('twofactor_test', '\\OCA\\TwoFactorTest\\Provider')
]); ]);

Loading…
Cancel
Save