function MetadataBagTest::testStampNew

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Session/MetadataBagTest.php \Drupal\Tests\Core\Session\MetadataBagTest::testStampNew()
  2. 10 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 20

Class

MetadataBagTest
@coversDefaultClass \Drupal\Core\Session\MetadataBag @group Session

Namespace

Drupal\Tests\Core\Session

Code

public function testStampNew() : void {
    $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.