function CsrfTokenGeneratorTest::testInvalidParameterTypes

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php \Drupal\Tests\Core\Access\CsrfTokenGeneratorTest::testInvalidParameterTypes()
  2. 10 core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php \Drupal\Tests\Core\Access\CsrfTokenGeneratorTest::testInvalidParameterTypes()
  3. 11.x core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php \Drupal\Tests\Core\Access\CsrfTokenGeneratorTest::testInvalidParameterTypes()

Tests CsrfTokenGenerator::validate() with invalid parameter types.

@covers ::validate @dataProvider providerTestInvalidParameterTypes

Parameters

mixed $token: The token to be validated.

mixed $value: (optional) An additional value to base the token on.

File

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

Class

CsrfTokenGeneratorTest
Tests the CsrfTokenGenerator class.

Namespace

Drupal\Tests\Core\Access

Code

public function testInvalidParameterTypes($token, $value = '') {
    $this->setupDefaultExpectations();
    $this->expectException(\InvalidArgumentException::class);
    $this->generator
        ->validate($token, $value);
}

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