diff --git a/core/modules/file/src/Tests/DownloadTest.php b/core/modules/file/src/Tests/DownloadTest.php index 4df65e5..22bee7a 100644 --- a/core/modules/file/src/Tests/DownloadTest.php +++ b/core/modules/file/src/Tests/DownloadTest.php @@ -52,19 +52,6 @@ public function testPrivateFileTransferWithoutPageCache() { } /** - * Test the private file transfer system with page cache. - */ - public function testPrivateFileTransferWithPageCache() { - // Turn on page caching and rerun the test. - $this->container->get('module_installer')->install(['page_cache']); - $config = $this->config('system.performance'); - $config->set('cache.page.max_age', 300); - $config->save(); - - $this->doPrivateFileTransferTest(); - } - - /** * Test the private file transfer system. */ protected function doPrivateFileTransferTest() { diff --git a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php index 88cf620..16fc8e6 100644 --- a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php +++ b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php @@ -79,22 +79,6 @@ function testImageStyleUrlAndPathPrivateUnclean() { } /** - * Tests an image style URL using the "public://" scheme and page cache. - */ - public function testImageStyleUrlAndPathPublicWithPageCache() { - $this->enablePageCache(); - $this->doImageStyleUrlAndPathTests('public'); - } - - /** - * Tests an image style URL using the "private://" scheme and page cache. - */ - public function testImageStyleUrlAndPathPrivateWithPageCache() { - $this->enablePageCache(); - $this->doImageStyleUrlAndPathTests('private'); - } - - /** * Tests an image style URL with a file URL that has an extra slash in it. */ function testImageStyleUrlExtraSlash() { @@ -242,15 +226,4 @@ function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_slash = $this->assertResponse(200, 'Image was accessible at the URL with a missing token.'); } - /** - * Turn on page caching. - */ - protected function enablePageCache() { - // Turn on page caching and rerun the test. - $this->container->get('module_installer')->install(['page_cache']); - $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 1bcf8ae..1bb2848 100644 --- a/core/modules/page_cache/src/Tests/PageCacheTest.php +++ b/core/modules/page_cache/src/Tests/PageCacheTest.php @@ -246,7 +246,6 @@ function testPageCache() { */ function testPageCacheAnonymousRolePermissions() { $config = $this->config('system.performance'); - $config->set('cache.page.use_internal', 1); $config->set('cache.page.max_age', 300); $config->save(); diff --git a/core/modules/page_cache/tests/modules/page_cache_form_test.install b/core/modules/page_cache/tests/modules/page_cache_form_test.install new file mode 100644 index 0000000..ecd7db8 --- /dev/null +++ b/core/modules/page_cache/tests/modules/page_cache_form_test.install @@ -0,0 +1,13 @@ +config('system.performance'); - $config->set('cache.page.use_internal', 1); - $config->set('cache.page.max_age', 300); - $config->save(); - // Create user. $this->searchingUser = $this->drupalCreateUser(array('search content', 'access user profiles')); diff --git a/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php b/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php index 58fd508..43e24ec 100644 --- a/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php +++ b/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php @@ -20,7 +20,6 @@ * Enables page caching. */ protected function enablePageCaching() { - \Drupal::service('module_installer')->install(['page_cache']); $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 0d0b841..3dc90bb 100644 --- a/core/modules/system/src/Tests/Session/SessionTest.php +++ b/core/modules/system/src/Tests/Session/SessionTest.php @@ -143,9 +143,7 @@ function testDataPersistence() { function testEmptyAnonymousSession() { // Verify that no session is automatically created for anonymous user when // page caching is disabled. - $config = $this->config('system.performance'); - $config->set('cache.page.use_internal', 0); - $config->save(); + $this->container->get('module_installer')->uninstall(['page_cache']); $this->drupalGet(''); $this->assertSessionCookie(FALSE); $this->assertSessionEmpty(TRUE); diff --git a/core/modules/system/src/Tests/System/ErrorHandlerTest.php b/core/modules/system/src/Tests/System/ErrorHandlerTest.php index d17e05c..147a4cb 100644 --- a/core/modules/system/src/Tests/System/ErrorHandlerTest.php +++ b/core/modules/system/src/Tests/System/ErrorHandlerTest.php @@ -153,12 +153,7 @@ function testExceptionHandler() { $this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), 'Received expected HTTP status line.'); $this->assertErrorMessage($error_renderer_exception); - // Enable the page cache and disable error reporting, ensure that 5xx - // responses are not cached. - \Drupal::service('module_installer')->install(['page_cache']); - $config = $this->config('system.performance'); - $config->set('cache.page.max_age', 300); - $config->save(); + // Disable error reporting, ensure that 5xx responses are not cached. $this->config('system.logging') ->set('error_level', ERROR_REPORTING_HIDE) ->save(); diff --git a/core/profiles/minimal/config/install/system.performance.yml b/core/profiles/minimal/config/install/system.performance.yml deleted file mode 100644 index 18238d5..0000000 --- a/core/profiles/minimal/config/install/system.performance.yml +++ /dev/null @@ -1,20 +0,0 @@ -cache: - page: - # @todo: Remove this file in https://www.drupal.org/node/2368987, update the - # install profile's YAML file to depend on the page_cache module instead. - use_internal: true - max_age: 0 -css: - preprocess: true - gzip: true -fast_404: - enabled: true - paths: '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i' - exclude_paths: '/\/(?:styles|imagecache)\//' - html: '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

' -js: - preprocess: true - gzip: true -response: - gzip: false -stale_file_threshold: 2592000 diff --git a/core/profiles/minimal/minimal.info.yml b/core/profiles/minimal/minimal.info.yml index d1f83de..206b8e7 100644 --- a/core/profiles/minimal/minimal.info.yml +++ b/core/profiles/minimal/minimal.info.yml @@ -7,5 +7,6 @@ dependencies: - node - block - dblog + - page_cache themes: - stark diff --git a/core/profiles/standard/config/install/system.performance.yml b/core/profiles/standard/config/install/system.performance.yml deleted file mode 100644 index 18238d5..0000000 --- a/core/profiles/standard/config/install/system.performance.yml +++ /dev/null @@ -1,20 +0,0 @@ -cache: - page: - # @todo: Remove this file in https://www.drupal.org/node/2368987, update the - # install profile's YAML file to depend on the page_cache module instead. - use_internal: true - max_age: 0 -css: - preprocess: true - gzip: true -fast_404: - enabled: true - paths: '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i' - exclude_paths: '/\/(?:styles|imagecache)\//' - html: '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

' -js: - preprocess: true - gzip: true -response: - gzip: false -stale_file_threshold: 2592000 diff --git a/core/profiles/standard/standard.info.yml b/core/profiles/standard/standard.info.yml index a1c07b2..a356ae8 100644 --- a/core/profiles/standard/standard.info.yml +++ b/core/profiles/standard/standard.info.yml @@ -25,6 +25,7 @@ dependencies: - menu_ui - options - path + - page_cache - taxonomy - dblog - search diff --git a/core/profiles/testing/config/install/system.performance.yml b/core/profiles/testing/config/install/system.performance.yml deleted file mode 100644 index 18238d5..0000000 --- a/core/profiles/testing/config/install/system.performance.yml +++ /dev/null @@ -1,20 +0,0 @@ -cache: - page: - # @todo: Remove this file in https://www.drupal.org/node/2368987, update the - # install profile's YAML file to depend on the page_cache module instead. - use_internal: true - max_age: 0 -css: - preprocess: true - gzip: true -fast_404: - enabled: true - paths: '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i' - exclude_paths: '/\/(?:styles|imagecache)\//' - html: '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

' -js: - preprocess: true - gzip: true -response: - gzip: false -stale_file_threshold: 2592000 diff --git a/core/profiles/testing/testing.info.yml b/core/profiles/testing/testing.info.yml index 1eb843d..5ded376 100644 --- a/core/profiles/testing/testing.info.yml +++ b/core/profiles/testing/testing.info.yml @@ -4,6 +4,10 @@ description: 'Minimal profile for running tests. Includes absolutely required mo version: VERSION core: 8.x hidden: true +dependencies: + # Enable page_cache in testing, to ensure that as many tests as possible run + # with page caching enabled. + - page_cache # @todo: Remove this in https://www.drupal.org/node/2352949 themes: - classy