You are here

protected function CsrfAccessCheckTest::setUp in Drupal 10

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

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Access/CsrfAccessCheckTest.php, line 38

Class

CsrfAccessCheckTest
@coversDefaultClass \Drupal\Core\Access\CsrfAccessCheck @group Access

Namespace

Drupal\Tests\Core\Access

Code

protected function setUp() : void {
  $this->csrfToken = $this
    ->getMockBuilder('Drupal\\Core\\Access\\CsrfTokenGenerator')
    ->disableOriginalConstructor()
    ->getMock();
  $this->routeMatch = $this
    ->createMock('Drupal\\Core\\Routing\\RouteMatchInterface');
  $this->accessCheck = new CsrfAccessCheck($this->csrfToken);
}