0, 'required' => TRUE, ]; $this->writeSettings($settings); } /** * Tests route collection cache after an exception. */ public function testRouteCollectionCacheAfterException(): void { // Force an exception early in the Kernel middleware on a cold cache by // simulating bad Bearer authentication. $this->drupalGet('/router-test/rejects-query-strings', [], [ 'Authorization' => 'Bearer invalid', ]); $this->assertSession()->statusCodeEquals(Response::HTTP_UNAUTHORIZED); // Check that the route collection cache does not recover any unexpected // query strings from the earlier request that involved an exception. // The requested controller returns 400 if there are any query parameters // present, similar to JSON:API paths that strictly filter requests. $this->drupalGet('/router-test/rejects-query-strings', [], [ 'Authorization' => 'Bearer valid', ]); $this->assertSession()->statusCodeEquals(Response::HTTP_OK); } }