You are here

protected function TfaContextTest::setUp in Two-factor Authentication (TFA) 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/TfaContextTest.php, line 75

Class

TfaContextTest
@coversDefaultClass \Drupal\tfa\TfaContext

Namespace

Drupal\Tests\tfa\Unit

Code

protected function setUp() : void {
  parent::setUp();

  // Setup default mocked services. These can be overridden by
  // re-instantiating them as needed prior to calling ::getFixture().
  $this->tfaValidationManager = $this
    ->prophesize(TfaValidationPluginManager::class)
    ->reveal();
  $this->tfaLoginManager = $this
    ->prophesize(TfaLoginPluginManager::class)
    ->reveal();
  $this->tfaSettings = $this
    ->prophesize(ImmutableConfig::class)
    ->reveal();
  $this->configFactory = $this
    ->prophesize(ConfigFactoryInterface::class);
  $this->configFactory
    ->get('tfa.settings')
    ->willReturn($this->tfaSettings);
  $this->configFactory = $this->configFactory
    ->reveal();
  $this->user = $this
    ->prophesize(UserInterface::class);
  $this->user
    ->id()
    ->willReturn(3);
  $this->user = $this->user
    ->reveal();
  $this->userData = $this
    ->prophesize(UserDataInterface::class)
    ->reveal();
  $this->request = $this
    ->prophesize(Request::class)
    ->reveal();
}