function ContextualDynamicContextTest::createContextualIdToken

Same name and namespace in other branches
  1. 9 core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php \Drupal\Tests\contextual\Functional\ContextualDynamicContextTest::createContextualIdToken()
  2. 10 core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php \Drupal\Tests\contextual\Functional\ContextualDynamicContextTest::createContextualIdToken()
  3. 11.x 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.

2 calls to ContextualDynamicContextTest::createContextualIdToken()
ContextualDynamicContextTest::assertContextualLinkPlaceHolder in core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php
Asserts that a contextual link placeholder with the given id exists.
ContextualDynamicContextTest::testTokenProtection in core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php
Tests the contextual placeholder content is protected by a token.

File

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

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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.