You are here

public function OpenIDConnectTest::testExtractSub in OpenID Connect / OAuth client 8

Test the extractSub method.

@dataProvider dataProviderForExtractSub

Parameters

array $userData: The user data as returned from OpenIDConnectClientInterface::decodeIdToken().

array $userInfo: The user claims as returned from OpenIDConnectClientInterface::retrieveUserInfo().

bool|string $expected: The expected result from the test.

File

tests/src/Unit/OpenIDConnectTest.php, line 287

Class

OpenIDConnectTest
Provides tests for the OpenID Connect module.

Namespace

Drupal\Tests\openid_connect\Unit

Code

public function testExtractSub(array $userData, array $userInfo, $expected) : void {
  $actual = $this->openIdConnect
    ->extractSub($userData, $userInfo);
  $this
    ->assertEquals($expected, $actual);
}