You are here

public function OpenIdConnectClaimsTest::testGetDefaultClaims 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::testGetDefaultClaims()

Test the default claims array.

@dataProvider defaultClaimsProvider The data profiled for the claims test.

Parameters

string $key: The key for the claim.

string $scope: The scope for the claim.

string $type: The data type for the claim.

File

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

Class

OpenIdConnectClaimsTest
Test the OpenIdConnectClaims class.

Namespace

Drupal\Tests\openid_connect\Unit

Code

public function testGetDefaultClaims($key, $scope, $type) : void {
  $claims = $this->openIdConnectClaims
    ->getClaims();

  // Ensure the default key exists.
  $this
    ->assertArrayHasKey($key, $claims);

  // Assert the scope is correct.
  $this
    ->assertEquals($scope, $claims[$key]['scope']);

  // Assert the type is correct.
  $this
    ->assertEquals($type, $claims[$key]['type']);
}