function CsrfTokenGeneratorTest::testGet

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php \Drupal\Tests\Core\Access\CsrfTokenGeneratorTest::testGet()
  2. 8.9.x core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php \Drupal\Tests\Core\Access\CsrfTokenGeneratorTest::testGet()
  3. 11.x 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 85

Class

CsrfTokenGeneratorTest
Tests the CsrfTokenGenerator class.

Namespace

Drupal\Tests\Core\Access

Code

public function testGet() : void {
    $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()));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.