You are here

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

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

Overrides UnitTestCase::setUp

File

tests/src/Unit/OpenIdConnectSessionTest.php, line 51

Class

OpenIdConnectSessionTest
@coversDefaultClass \Drupal\openid_connect\OpenIDConnectSession @group openid_connect

Namespace

Drupal\Tests\openid_connect\Unit

Code

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

  // Mock the currentPath service.
  $this->currentPath = $this
    ->createMock(CurrentPathStack::class);

  // Mock the Request class that is returned by RequestStack class.
  $request = $this
    ->createMock(Request::class);
  $request
    ->expects($this
    ->once())
    ->method('getQueryString')
    ->willReturn('sport=baseball&team=reds');

  // Mock the requestStack service.
  $this->requestStack = $this
    ->createMock(RequestStack::class);
  $this->requestStack
    ->expects($this
    ->once())
    ->method('getCurrentRequest')
    ->willReturn($request);
}