diff -u b/core/modules/page_cache/tests/src/Functional/PageCacheTest.php b/core/modules/page_cache/tests/src/Functional/PageCacheTest.php --- b/core/modules/page_cache/tests/src/Functional/PageCacheTest.php +++ b/core/modules/page_cache/tests/src/Functional/PageCacheTest.php @@ -414,13 +414,13 @@ $this->assertSession()->statusCodeEquals($code); $this->assertSession()->responseHeaderEquals('X-Drupal-Cache', 'MISS'); $this->drupalGet($content_url); - $this->assertResponse($code); + $this->assertSession()->statusCodeEquals($code); $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT'); // Setting cache.page.4xx_max_age should invalidate the 4xx cache tag. $config->set('cache.page.4xx_max_age', 0)->save(); $this->drupalGet($content_url); - $this->assertResponse($code); + $this->assertSession()->statusCodeEquals($code); $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS'); $this->assertEqual($this->drupalGetHeader('Cache-Control'), 'must-revalidate, no-cache, private'); reverted: --- b/core/modules/system/system.install +++ a/core/modules/system/system.install @@ -1457,12 +1457,3 @@ } } } - -/** - * Set max-age for 4xx responses to null. - */ -function system_update_8703() { - \Drupal::configFactory()->getEditable('system.performance') - ->set('cache.page.4xx_max_age', NULL) - ->save(TRUE); -} diff -u b/core/modules/system/tests/src/Functional/Update/AddPageCache4xxMaxAgeToSystemPerformanceConfigurationTest.php b/core/modules/system/tests/src/Functional/Update/AddPageCache4xxMaxAgeToSystemPerformanceConfigurationTest.php --- b/core/modules/system/tests/src/Functional/Update/AddPageCache4xxMaxAgeToSystemPerformanceConfigurationTest.php +++ b/core/modules/system/tests/src/Functional/Update/AddPageCache4xxMaxAgeToSystemPerformanceConfigurationTest.php @@ -16,7 +16,7 @@ */ protected function setDatabaseDumpFiles() { $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz', + __DIR__ . '/../../../fixtures/update/drupal-8.8.0.bare.standard.php.gz', ]; } @@ -25,14 +25,13 @@ * configuration. */ public function testUpdate() { - \Drupal::configFactory()->getEditable('system.performance') - ->set('cache.page.4xx_max_age', NULL) - ->save(TRUE); + $system_performance = \Drupal::config('system.performance')->get(); + $this->assertArrayNotHasKey('4xx_max_age', $system_performance['cache']['page'], 'Configuration cache.page.4xx_max_age does not exist in system.performance.'); $this->runUpdates(); $system_performance = \Drupal::config('system.performance')->get(); - $this->assertTrue(array_key_exists('4xx_max_age', $system_performance['cache']['page']), 'Configuration cache.page.4xx_max_age has been added to system.performance.'); + $this->assertArrayHasKey('4xx_max_age', $system_performance['cache']['page'], 'Configuration cache.page.4xx_max_age has been added to system.performance.'); } } only in patch2: unchanged: --- a/core/modules/system/system.post_update.php +++ b/core/modules/system/system.post_update.php @@ -168,3 +168,12 @@ function system_post_update_schema_version_int() { } } } + +/** + * Set max-age for 4xx responses to null. + */ +function system_post_update_set_max_age_4xx() { + \Drupal::configFactory()->getEditable('system.performance') + ->set('cache.page.4xx_max_age', NULL) + ->save(TRUE); +}