You are here

protected function ContextualDynamicContextTest::createContextualIdToken in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php \Drupal\Tests\contextual\Functional\ContextualDynamicContextTest::createContextualIdToken()
  2. 9 core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php \Drupal\Tests\contextual\Functional\ContextualDynamicContextTest::createContextualIdToken()

Creates a contextual ID token.

Parameters

string $id: The contextual ID to create a token for.

Return value

string The contextual ID token.

File

core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php, line 286

Class

ContextualDynamicContextTest
Tests if contextual links are showing on the front page depending on permissions.

Namespace

Drupal\Tests\contextual\Functional

Code

protected function createContextualIdToken($id) {
  return Crypt::hmacBase64($id, Settings::getHashSalt() . $this->container
    ->get('private_key')
    ->get());
}