function CsrfTokenGeneratorTest::setUp
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php \Drupal\Tests\Core\Access\CsrfTokenGeneratorTest::setUp()
- 10 core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php \Drupal\Tests\Core\Access\CsrfTokenGeneratorTest::setUp()
- 11.x core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php \Drupal\Tests\Core\Access\CsrfTokenGeneratorTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
tests/ Drupal/ Tests/ Core/ Access/ CsrfTokenGeneratorTest.php, line 42
Class
- CsrfTokenGeneratorTest
- Tests the CsrfTokenGenerator class.
Namespace
Drupal\Tests\Core\AccessCode
protected function setUp() {
parent::setUp();
$this->privateKey = $this->getMockBuilder('Drupal\\Core\\PrivateKey')
->disableOriginalConstructor()
->setMethods([
'get',
])
->getMock();
$this->sessionMetadata = $this->getMockBuilder('Drupal\\Core\\Session\\MetadataBag')
->disableOriginalConstructor()
->getMock();
$settings = [
'hash_salt' => $this->randomMachineName(),
];
new Settings($settings);
$this->generator = new CsrfTokenGenerator($this->privateKey, $this->sessionMetadata);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.