You are here

protected function OpenIdConnectClaimsTest::setUp in OpenID Connect / OAuth client 8

Same name and namespace in other branches
  1. 2.x tests/src/Unit/OpenIdConnectClaimsTest.php \Drupal\Tests\openid_connect\Unit\OpenIdConnectClaimsTest::setUp()

Overrides UnitTestCase::setUp

File

tests/src/Unit/OpenIdConnectClaimsTest.php, line 66

Class

OpenIdConnectClaimsTest
Test the OpenIdConnectClaims class.

Namespace

Drupal\Tests\openid_connect\Unit

Code

protected function setUp() : void {
  parent::setUp();
  $this->configFactory = $this
    ->createMock(ConfigFactory::class);
  $this->moduleHandler = $this
    ->createMock(ModuleHandler::class);
  $this->container = new ContainerBuilder();
  $this->container
    ->set('module_handler', $this->moduleHandler);
  $this->container
    ->set('config.factory', $this->configFactory);
  $this->container
    ->set('string_translation', self::getStringTranslationStub());
  \Drupal::setContainer($this->container);
  $this->openIdConnectClaims = OpenIDConnectClaims::create($this->container);
}