You are here

public function CsrfTokenGeneratorTest::testGet in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 88
Contains \Drupal\Tests\Core\Access\CsrfTokenGeneratorTest.

Class

CsrfTokenGeneratorTest
Tests the CsrfTokenGenerator class.

Namespace

Drupal\Tests\Core\Access

Code

public function testGet() {
  $this
    ->setupDefaultExpectations();
  $this
    ->assertInternalType('string', $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()));
}