function MetadataBagTest::testStampNew
Same name and namespace in other branches
- 10 core/tests/Drupal/Tests/Core/Session/MetadataBagTest.php \Drupal\Tests\Core\Session\MetadataBagTest::testStampNew()
- 11.x core/tests/Drupal/Tests/Core/Session/MetadataBagTest.php \Drupal\Tests\Core\Session\MetadataBagTest::testStampNew()
@covers ::stampNew
File
-
core/
tests/ Drupal/ Tests/ Core/ Session/ MetadataBagTest.php, line 18
Class
- MetadataBagTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Session%21MetadataBag.php/class/MetadataBag/9" title="Provides a container for application specific session metadata." class="local">\Drupal\Core\Session\MetadataBag</a> @group Session
Namespace
Drupal\Tests\Core\SessionCode
public function testStampNew() {
$metadata = new MetadataBag(new Settings([]));
$metadata->setCsrfTokenSeed('a_cryptographically_secure_long_random_string_should_used_here');
$metadata->stampNew();
$this->assertNotEquals('a_cryptographically_secure_long_random_string_should_used_here', $metadata->getCsrfTokenSeed());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.