protected function MasqueradeWebTestBase::drupalGetToken in Masquerade 8.2
Stop-gap fix.
See also
http://drupal.org/node/1555862
1 call to MasqueradeWebTestBase::drupalGetToken()
- MasqueradeTest::testMasquerade in tests/
src/ Functional/ MasqueradeTest.php - Tests masquerade user links.
File
- tests/
src/ Functional/ MasqueradeWebTestBase.php, line 286
Class
- MasqueradeWebTestBase
- Base test class for Masquerade module web tests.
Namespace
Drupal\Tests\masquerade\FunctionalCode
protected function drupalGetToken($value = '') {
// Use the same code as \Drupal\Core\Access\CsrfTokenGenerator::get().
$private_key = $this->container
->get('private_key')
->get();
/** @var \Drupal\Core\Session\MetadataBag $session_metadata */
$session_metadata = $this->container
->get('session_manager.metadata_bag');
// @TODO Try to get seed from testing site, broken now.
$seed = $session_metadata
->getCsrfTokenSeed();
return Crypt::hmacBase64($value, $seed . $private_key . Settings::getHashSalt());
}