You are here

public function MetadataBagTest::testStampNew in Drupal 10

Same name and namespace in other branches
  1. 9 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 \Drupal\Core\Session\MetadataBag @group Session

Namespace

Drupal\Tests\Core\Session

Code

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