diff --git a/core/core.services.yml b/core/core.services.yml index a387699..2d75920 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -220,7 +220,7 @@ services: arguments: ['@request_stack', '@url_generator'] form_cache: class: Drupal\Core\Form\FormCache - arguments: ['@app.root', '@keyvalue.expirable', '@module_handler', '@current_user', '@csrf_token', '@logger.channel.form', '@config.factory', '@request_stack', '@page_cache_request_policy'] + arguments: ['@app.root', '@keyvalue.expirable', '@module_handler', '@current_user', '@csrf_token', '@logger.channel.form', '@request_stack', '@page_cache_request_policy'] public: false # Private to form_builder keyvalue: class: Drupal\Core\KeyValueStore\KeyValueFactory diff --git a/core/lib/Drupal/Core/Form/FormCache.php b/core/lib/Drupal/Core/Form/FormCache.php index fa03bac..a35000d 100644 --- a/core/lib/Drupal/Core/Form/FormCache.php +++ b/core/lib/Drupal/Core/Form/FormCache.php @@ -10,7 +10,6 @@ use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Access\CsrfTokenGenerator; -use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface; use Drupal\Core\PageCache\RequestPolicyInterface; @@ -104,20 +103,17 @@ class FormCache implements FormCacheInterface { * The CSRF token generator. * @param \Psr\Log\LoggerInterface $logger * A logger instance. - * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory - * The configuration factory. * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack * The request stack. * @param \Drupal\Core\PageCache\RequestPolicyInterface $request_policy * A policy rule determining the cacheability of a request. */ - public function __construct($root, KeyValueExpirableFactoryInterface $key_value_expirable_factory, ModuleHandlerInterface $module_handler, AccountInterface $current_user, CsrfTokenGenerator $csrf_token, LoggerInterface $logger, ConfigFactoryInterface $config_factory, RequestStack $request_stack, RequestPolicyInterface $request_policy) { + public function __construct($root, KeyValueExpirableFactoryInterface $key_value_expirable_factory, ModuleHandlerInterface $module_handler, AccountInterface $current_user, CsrfTokenGenerator $csrf_token, LoggerInterface $logger, RequestStack $request_stack, RequestPolicyInterface $request_policy) { $this->root = $root; $this->keyValueExpirableFactory = $key_value_expirable_factory; $this->moduleHandler = $module_handler; $this->currentUser = $current_user; $this->logger = $logger; - $this->configFactory = $config_factory; $this->csrfToken = $csrf_token; $this->requestStack = $request_stack; $this->requestPolicy = $request_policy; diff --git a/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php b/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php index 44c14f1..942aa1d 100644 --- a/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php +++ b/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php @@ -24,7 +24,7 @@ class BasicAuthTest extends WebTestBase { * * @var array */ - public static $modules = array('basic_auth', 'router_test', 'locale'); + public static $modules = array('basic_auth', 'router_test', 'locale', 'page_cache'); /** * Test http basic authentication. @@ -32,7 +32,6 @@ class BasicAuthTest extends WebTestBase { public function testBasicAuth() { // Enable page caching. $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/src/Tests/PageCacheTagsIntegrationTest.php b/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php index 6d9db85..e6a5d74 100644 --- a/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php +++ b/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php @@ -8,6 +8,7 @@ namespace Drupal\page_cache\Tests; use Drupal\simpletest\WebTestBase; +use Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait; /** * Enables the page cache and tests its cache tags in various scenarios. diff --git a/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php b/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php index 307da6d..0b4a205 100644 --- a/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php +++ b/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php @@ -22,7 +22,6 @@ protected function enablePageCaching() { \Drupal::service('module_installer')->install(['page_cache']); $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/system/src/Tests/System/ErrorHandlerTest.php b/core/modules/system/src/Tests/System/ErrorHandlerTest.php index 9d1437f..07bb0be 100644 --- a/core/modules/system/src/Tests/System/ErrorHandlerTest.php +++ b/core/modules/system/src/Tests/System/ErrorHandlerTest.php @@ -155,8 +155,8 @@ function testExceptionHandler() { // 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.use_internal', 1); $config->set('cache.page.max_age', 300); $config->save(); $this->config('system.logging') diff --git a/core/modules/system/src/Tests/System/SiteMaintenanceTest.php b/core/modules/system/src/Tests/System/SiteMaintenanceTest.php index 4b42674..4890975 100644 --- a/core/modules/system/src/Tests/System/SiteMaintenanceTest.php +++ b/core/modules/system/src/Tests/System/SiteMaintenanceTest.php @@ -42,9 +42,6 @@ protected function setUp() { * Verify site maintenance mode functionality with page cache disabled. */ function testSiteMaintenanceWithoutPageCache() { - $config = $this->config('system.performance'); - $config->set('cache.page.use_internal', 0); - $config->save(); $this->doTestSiteMaintenance(); } @@ -52,10 +49,6 @@ function testSiteMaintenanceWithoutPageCache() { * Verify site maintenance mode functionality with page cache enabled. */ function testSiteMaintenanceWithPageCache() { - $config = $this->config('system.performance'); - $config->set('cache.page.use_internal', 1); - $config->set('cache.page.max_age', 300); - $config->save(); $this->doTestSiteMaintenance(); } diff --git a/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php b/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php index 1820932..4f145dc 100644 --- a/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php +++ b/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php @@ -75,13 +75,6 @@ class FormCacheTest extends UnitTestCase { protected $logger; /** - * The config factory. - * - * @var \Drupal\Core\Config\ConfigFactoryInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $configFactory; - - /** * The request stack. * * @var \Symfony\Component\HttpFoundation\RequestStack|\PHPUnit_Framework_MockObject_MockObject @@ -121,11 +114,10 @@ protected function setUp() { $this->account = $this->getMock('Drupal\Core\Session\AccountInterface'); $this->logger = $this->getMock('Psr\Log\LoggerInterface'); - $this->configFactory = $this->getConfigFactoryStub(['system.performance' => ['cache.page.use_internal' => FALSE]]); $this->requestStack = $this->getMock('\Symfony\Component\HttpFoundation\RequestStack'); $this->requestPolicy = $this->getMock('\Drupal\Core\PageCache\RequestPolicyInterface'); - $this->formCache = new FormCache($this->root, $this->keyValueExpirableFactory, $this->moduleHandler, $this->account, $this->csrfToken, $this->logger, $this->configFactory, $this->requestStack, $this->requestPolicy); + $this->formCache = new FormCache($this->root, $this->keyValueExpirableFactory, $this->moduleHandler, $this->account, $this->csrfToken, $this->logger, $this->requestStack, $this->requestPolicy); } /**