public function RouteProcessorCsrfTest::testProcessOutboundNoRequirement in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Access/RouteProcessorCsrfTest.php \Drupal\Tests\Core\Access\RouteProcessorCsrfTest::testProcessOutboundNoRequirement()
- 10 core/tests/Drupal/Tests/Core/Access/RouteProcessorCsrfTest.php \Drupal\Tests\Core\Access\RouteProcessorCsrfTest::testProcessOutboundNoRequirement()
Tests the processOutbound() method with no _csrf_token route requirement.
File
- core/
tests/ Drupal/ Tests/ Core/ Access/ RouteProcessorCsrfTest.php, line 42
Class
- RouteProcessorCsrfTest
- @coversDefaultClass \Drupal\Core\Access\RouteProcessorCsrf @group Access
Namespace
Drupal\Tests\Core\AccessCode
public function testProcessOutboundNoRequirement() {
$this->csrfToken
->expects($this
->never())
->method('get');
$route = new Route('/test-path');
$parameters = [];
$bubbleable_metadata = new BubbleableMetadata();
$this->processor
->processOutbound('test', $route, $parameters, $bubbleable_metadata);
// No parameters should be added to the parameters array.
$this
->assertEmpty($parameters);
// Cacheability of routes without a _csrf_token route requirement is
// unaffected.
$this
->assertEquals(new BubbleableMetadata(), $bubbleable_metadata);
}