function RouteCachingQueryAlteredTest::setUp

Same name in other branches
  1. 11.x core/tests/Drupal/FunctionalTests/Routing/RouteCachingQueryAlteredTest.php \Drupal\FunctionalTests\Routing\RouteCachingQueryAlteredTest::setUp()

Overrides BrowserTestBase::setUp

File

core/tests/Drupal/FunctionalTests/Routing/RouteCachingQueryAlteredTest.php, line 33

Class

RouteCachingQueryAlteredTest
Tests the route cache when the request's query parameters are altered.

Namespace

Drupal\FunctionalTests\Routing

Code

protected function setUp() : void {
    parent::setUp();
    // page_cache module is enabled in the testing profile, however by default
    // exceptions which create 4xx responses are cached for 1 hour. This is
    // undesirable for certain response types (e.g., 401) which vary on other
    // elements of the request than the URL. For this reason, do not cache 4xx
    // responses for the purposes of this test.
    $settings['settings']['cache_ttl_4xx'] = (object) [
        'value' => 0,
        'required' => TRUE,
    ];
    $this->writeSettings($settings);
}

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