core/modules/block/src/Tests/BlockTest.php | 4 +++- core/modules/file/src/Tests/DownloadTest.php | 4 +++- core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php | 4 +++- .../page_cache/src/Tests/PageCacheTagsIntegrationTest.php | 4 +++- core/modules/page_cache/src/Tests/PageCacheTest.php | 14 ++++++++++---- .../system/src/Tests/Ajax/AjaxFormPageCacheTest.php | 4 +++- .../system/src/Tests/Cache/PageCacheTagsTestBase.php | 4 +++- .../system/src/Tests/Form/FormStoragePageCacheTest.php | 4 +++- core/modules/system/src/Tests/Session/SessionTest.php | 4 +++- 9 files changed, 34 insertions(+), 12 deletions(-) diff --git a/core/modules/block/src/Tests/BlockTest.php b/core/modules/block/src/Tests/BlockTest.php index 8cdab7f..1ff3946 100644 --- a/core/modules/block/src/Tests/BlockTest.php +++ b/core/modules/block/src/Tests/BlockTest.php @@ -312,7 +312,9 @@ public function testBlockCacheTags() { $this->drupalLogout(); // Enable page caching. - $this->config('system.performance')->set('cache.page.max_age', 300)->save(); + $config = $this->config('system.performance'); + $config->set('cache.page.max_age', 300); + $config->save(); // Place the "Powered by Drupal" block. $block = $this->drupalPlaceBlock('system_powered_by_block', array('id' => 'powered', 'cache' => array('max_age' => 315360000))); diff --git a/core/modules/file/src/Tests/DownloadTest.php b/core/modules/file/src/Tests/DownloadTest.php index 87c4aa3..165a76a 100644 --- a/core/modules/file/src/Tests/DownloadTest.php +++ b/core/modules/file/src/Tests/DownloadTest.php @@ -58,7 +58,9 @@ public function testPrivateFileTransferWithPageCache() { // Turn on page caching and rerun the test. $this->assertTrue($this->container->get('module_installer')->install(['page_cache']), 'Page cache module installed.'); $this->rebuildContainer(); - $this->config('system.performance')->set('cache.page.max_age', 300)->save(); + $config = $this->config('system.performance'); + $config->set('cache.page.max_age', 300); + $config->save(); $this->doPrivateFileTransferTest(); } diff --git a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php index 1960d0f..dba4cec 100644 --- a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php +++ b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php @@ -249,7 +249,9 @@ protected function enablePageCache() { // Turn on page caching and rerun the test. $this->assertTrue($this->container->get('module_installer')->install(['page_cache']), 'Page cache module installed.'); $this->rebuildContainer(); - $this->config('system.performance')->set('cache.page.max_age', 300)->save(); + $config = $this->config('system.performance'); + $config->set('cache.page.max_age', 300); + $config->save(); } } diff --git a/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php b/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php index 8226c01..1d1b558 100644 --- a/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php +++ b/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php @@ -31,7 +31,9 @@ class PageCacheTagsIntegrationTest extends WebTestBase { protected function setUp() { parent::setUp(); - $this->config('system.performance')->set('cache.page.max_age', 300)->save(); + $config = $this->config('system.performance'); + $config->set('cache.page.max_age', 300); + $config->save(); } /** diff --git a/core/modules/page_cache/src/Tests/PageCacheTest.php b/core/modules/page_cache/src/Tests/PageCacheTest.php index 6c6fb06..0aef91f 100644 --- a/core/modules/page_cache/src/Tests/PageCacheTest.php +++ b/core/modules/page_cache/src/Tests/PageCacheTest.php @@ -36,7 +36,9 @@ protected function setUp() { ->set('page.front', 'test-page') ->save(); - $this->config('system.performance')->set('cache.page.max_age', 300)->save(); + $config = $this->config('system.performance'); + $config->set('cache.page.max_age', 300); + $config->save(); } /** @@ -136,7 +138,9 @@ function testConditionalRequests() { * Tests cache headers. */ function testPageCache() { - $this->config('system.performance')->set('response.gzip', 1)->save(); + $config = $this->config('system.performance'); + $config->set('response.gzip', 1); + $config->save(); // Fill the cache. $this->drupalGet('system-test/set-header', array('query' => array('name' => 'Foo', 'value' => 'bar'))); @@ -204,7 +208,8 @@ public function testPageCacheWithoutVaryCookie() { */ function testPageCompression() { $config = $this->config('system.performance'); - $config->set('response.gzip', 1)->save(); + $config->set('response.gzip', 1); + $config->save(); // Fill the cache and verify that output is compressed. $this->drupalGet('', array(), array('Accept-Encoding: gzip,deflate')); @@ -227,7 +232,8 @@ function testPageCompression() { $this->assertRaw('', 'Page was not compressed.'); // Disable compression mode. - $config->set('response.gzip', 0)->save(); + $config->set('response.gzip', 0); + $config->save(); // Verify if cached page is still available for a client with compression support. $this->drupalGet('', array(), array('Accept-Encoding: gzip,deflate')); diff --git a/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php b/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php index f58b08a..3e36515 100644 --- a/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php +++ b/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php @@ -25,7 +25,9 @@ class AjaxFormPageCacheTest extends AjaxTestBase { public function setUp() { parent::setUp(); - $this->config('system.performance')->set('cache.page.max_age', 300)->save(); + $config = $this->config('system.performance'); + $config->set('cache.page.max_age', 300); + $config->save(); } /** diff --git a/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php b/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php index af738ad..7909300 100644 --- a/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php +++ b/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php @@ -35,7 +35,9 @@ protected function setUp() { parent::setUp(); // Enable page caching. - $this->config('system.performance')->set('cache.page.max_age', 300)->save(); + $config = $this->config('system.performance'); + $config->set('cache.page.max_age', 3600); + $config->save(); } /** diff --git a/core/modules/system/src/Tests/Form/FormStoragePageCacheTest.php b/core/modules/system/src/Tests/Form/FormStoragePageCacheTest.php index 75bd207..bac12db 100644 --- a/core/modules/system/src/Tests/Form/FormStoragePageCacheTest.php +++ b/core/modules/system/src/Tests/Form/FormStoragePageCacheTest.php @@ -27,7 +27,9 @@ class FormStoragePageCacheTest extends WebTestBase { protected function setUp() { parent::setUp(); - $this->config('system.performance')->set('cache.page.max_age', 300)->save(); + $config = $this->config('system.performance'); + $config->set('cache.page.max_age', 300); + $config->save(); } /** diff --git a/core/modules/system/src/Tests/Session/SessionTest.php b/core/modules/system/src/Tests/Session/SessionTest.php index e2c38f9..c5a7220 100644 --- a/core/modules/system/src/Tests/Session/SessionTest.php +++ b/core/modules/system/src/Tests/Session/SessionTest.php @@ -146,7 +146,9 @@ function testEmptyAnonymousSession() { // The same behavior is expected when caching is enabled. $this->assertTrue($this->container->get('module_installer')->install(['page_cache']), 'Page cache module installed.'); $this->rebuildContainer(); - $this->config('system.performance')->set('cache.page.max_age', 300)->save(); + $config = $this->config('system.performance'); + $config->set('cache.page.max_age', 300); + $config->save(); $this->drupalGet(''); $this->assertSessionCookie(FALSE); // @todo Reinstate when REQUEST and RESPONSE events fire for cached pages.