Skip to content
Snippets Groups Projects
Verified Commit 1c8f4abe authored by Jess's avatar Jess
Browse files

Issue #3300773 by bradjones1, xjm, catch, andypost, Spokje: Fix failed test on...

Issue #3300773 by bradjones1, xjm, catch, andypost, Spokje: Fix failed test on `symfony/http-foundation` 4.4.44/6.1.3 and later
parent a243c347
No related branches found
No related tags found
16 merge requests!8357Issue #2994000 by Lendude, Pasqualle, quietone, pameeela: Notice in logs when...,!4488Issue #3376281: Random machine names no longer need to be wrapped in strtolower(),!3149Issue #3282285: Email "" does not comply with addr-spec of RFC 2822,!3000Issue #793660: Check for failure of hook_install,!2940Issue #3320240: Entity count query returns a string instead of int,!2937Issue #3315245: Order of languages overrides default language fallback,!2877Issue #3056652 by yogeshmpawar, mashermike, aalin, ranjith_kumar_k_u: Link...,!2804URL of image field formatter use absolute URL option.,!2749Issue #3309024: Focus on the wrong submit button after AJAX submit,!2692Issue #3284010 by _shY, mherchel, Abhijith S: "Create content" link within...,!2608Issue #2430379 by quietone, znerol, larowlan: Add explicit test for session...,!2575Issue #3198340 by alexpott, xjm, cilefen, Mile23, mmjvb, catch, longwave, mfb,...,!1627Issue #3082958: Add gitignore(s) to composer-ready project templates,!1014Issue #3226806: Move filter implementations from filter.module to plugin classes,!939Issue #2971209: Allow the MediaLibraryUiBuilder service to use an alternative view display,!88Issue #3163299: Ajax exposed filters not working for multiple instances of the same Views block placed on one page
......@@ -15,12 +15,14 @@
*/
class TestControllers {
const LONG_TEXT = 'This is text long enough to trigger Apache mod_deflate to add a `vary: accept-encoding` header to the response.';
public function test() {
return new Response('test');
}
public function test1() {
return new Response('test1');
return new Response(self::LONG_TEXT);
}
public function test2() {
......
......@@ -5,6 +5,7 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\EventSubscriber\MainContentViewSubscriber;
use Drupal\Core\Language\LanguageInterface;
use Drupal\router_test\TestControllers;
use Drupal\Tests\BrowserTestBase;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Drupal\Core\Url;
......@@ -38,7 +39,7 @@ public function testFinishResponseSubscriber() {
// Confirm that the router can get to a controller.
$this->drupalGet('router_test/test1');
$this->assertSession()->pageTextContains('test1');
$this->assertSession()->pageTextContains(TestControllers::LONG_TEXT);
$session = $this->getSession();
// Check expected headers from FinishResponseSubscriber.
......@@ -46,7 +47,9 @@ public function testFinishResponseSubscriber() {
$this->assertSession()->responseHeaderEquals('Content-language', 'en');
$this->assertSession()->responseHeaderEquals('X-Content-Type-Options', 'nosniff');
$this->assertSession()->responseHeaderEquals('X-Frame-Options', 'SAMEORIGIN');
$this->assertSession()->responseHeaderDoesNotExist('Vary');
if (strcasecmp($session->getResponseHeader('vary'), 'accept-encoding') !== 0) {
$this->assertSession()->responseHeaderDoesNotExist('Vary');
}
$this->drupalGet('router_test/test2');
$this->assertSession()->pageTextContains('test2');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment