You are here

public function CsrfTokenGeneratorTest::testGet in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php \Drupal\Tests\Core\Access\CsrfTokenGeneratorTest::testGet()
  2. 9 core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php \Drupal\Tests\Core\Access\CsrfTokenGeneratorTest::testGet()

Tests CsrfTokenGenerator::get().

@covers ::get

File

core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php, line 83

Class

CsrfTokenGeneratorTest
Tests the CsrfTokenGenerator class.

Namespace

Drupal\Tests\Core\Access

Code

public function testGet() {
  $this
    ->setupDefaultExpectations();
  $this
    ->assertIsString($this->generator
    ->get());
  $this
    ->assertNotSame($this->generator
    ->get(), $this->generator
    ->get($this
    ->randomMachineName()));
  $this
    ->assertNotSame($this->generator
    ->get($this
    ->randomMachineName()), $this->generator
    ->get($this
    ->randomMachineName()));
}