diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 493fa32..bc62f1b 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -1433,9 +1433,6 @@ function drupal_serve_page_from_cache(stdClass $cache) { // fields that fully determines whether a cache is permitted to use the // response to reply to a subsequent request for a given URL without // revalidation. - debug(123); - debug($boot_headers['vary']); - debug(settings()->get('omit_vary_cookie')); if (!isset($boot_headers['vary']) && !settings()->get('omit_vary_cookie')) { header('Vary: Cookie'); } diff --git a/core/lib/Drupal/Component/Utility/Settings.php b/core/lib/Drupal/Component/Utility/Settings.php index 57cc416..eb59e66 100644 --- a/core/lib/Drupal/Component/Utility/Settings.php +++ b/core/lib/Drupal/Component/Utility/Settings.php @@ -78,18 +78,4 @@ public function getAll() { return $this->storage; } - /** - * Set a value in the setting, NEVER use this unless you know what you do. - * - * Use the settings.php unless you write a test for a setting. - * - * @param string $name - * The name of the setting to change. - * @param mixed $value - * The new value of the setting. - */ - public function set($name, $value) { - $this->storage[$name] = $value; - } - } diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php index 6b4a033..8ee5bba 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php @@ -41,7 +41,7 @@ function setUp() { /** * Tests support of requests with If-Modified-Since and If-None-Match headers. */ - function _testConditionalRequests() { + function testConditionalRequests() { $config = config('system.performance'); $config->set('cache.page.use_internal', 1); $config->set('cache.page.max_age', 300); @@ -126,12 +126,13 @@ function testPageCache() { // Check the omit_vary_cookie setting. $this->drupalLogout(); - // Remove the page cache in order to hit the uncached page. - cache('page')->deleteAll(); - settings()->set('omit_vary_cookie', TRUE); + $settings['settings']['omit_vary_cookie'] = (object) array( + 'value' => TRUE, + 'required' => TRUE, + ); + $this->writeSettings($settings); $this->drupalGet('system-test/set-header', array('query' => array('name' => 'Foo', 'value' => 'bar'))); $this->assertTrue(strpos($this->drupalGetHeader('Vary'), 'Cookie') === FALSE, 'Vary: Cookie header was not sent.'); - $this->container->get('settings')->set('omit_vary_cookie', FALSE); } /** @@ -141,7 +142,7 @@ function testPageCache() { * .htaccess or similar, or if compression is done outside PHP, e.g. by the * mod_deflate Apache module. */ - function _testPageCompression() { + function testPageCompression() { $config = config('system.performance'); $config->set('cache.page.use_internal', 1); $config->set('cache.page.max_age', 300);