diff --git a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php index 05a34c6c4cf06545d2e3daa10141d82f15bff2c2..384440cb12aadf0bbb1534bb2b6cc534b57396d2 100644 --- a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php +++ b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php @@ -8,6 +8,7 @@ namespace Drupal\system\Tests\Update; use Drupal\Component\Utility\Crypt; +use Drupal\config\Tests\SchemaCheckTestTrait; use Drupal\Core\Database\Database; use Drupal\Core\Url; use Drupal\simpletest\WebTestBase; @@ -35,6 +36,8 @@ */ abstract class UpdatePathTestBase extends WebTestBase { + use SchemaCheckTestTrait; + /** * Modules to enable after the database is loaded. */ @@ -100,6 +103,15 @@ abstract class UpdatePathTestBase extends WebTestBase { */ protected $updateUrl; + /** + * Disable strict config schema checking. + * + * The schema is verified at the end of running the update. + * + * @var bool + */ + protected $strictConfigSchema = FALSE; + /** * Constructs an UpdatePathTestCase object. * @@ -217,6 +229,17 @@ protected function runUpdates() { // Run the update hooks. $this->clickLink(t('Apply pending updates')); + + // The config schema can be incorrect while the update functions are being + // executed. But once the update has been completed, it needs to be valid + // again. Assert the schema of all configuration objects now. + $names = $this->container->get('config.storage')->listAll(); + /** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */ + $typed_config = $this->container->get('config.typed'); + foreach ($names as $name) { + $config = $this->config($name); + $this->assertConfigSchema($typed_config, $name, $config->get()); + } } /** diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 042c8f29c96f3e70ffe2ceaca7239edcb510db47..948e6f4e5270aeee195042514ea8fe5a055eeb59 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1203,3 +1203,10 @@ function system_update_8001(&$sandbox = NULL) { } } +/** + * Removes the system.filter configuration. + */ +function system_update_8002() { + \Drupal::configFactory()->getEditable('system.filter')->delete(); + return t('The system.filter configuration has been moved to a container parameter, see default.services.yml for more information.'); +}