Loading core/modules/system/tests/modules/router_test_directory/src/TestControllers.php +3 −1 Original line number Diff line number Diff line Loading @@ -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() { Loading core/modules/system/tests/src/Functional/Routing/RouterTest.php +5 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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. Loading @@ -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'); if (strcasecmp($session->getResponseHeader('vary'), 'accept-encoding') !== 0) { $this->assertSession()->responseHeaderDoesNotExist('Vary'); } $this->drupalGet('router_test/test2'); $this->assertSession()->pageTextContains('test2'); Loading Loading
core/modules/system/tests/modules/router_test_directory/src/TestControllers.php +3 −1 Original line number Diff line number Diff line Loading @@ -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() { Loading
core/modules/system/tests/src/Functional/Routing/RouterTest.php +5 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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. Loading @@ -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'); if (strcasecmp($session->getResponseHeader('vary'), 'accept-encoding') !== 0) { $this->assertSession()->responseHeaderDoesNotExist('Vary'); } $this->drupalGet('router_test/test2'); $this->assertSession()->pageTextContains('test2'); Loading