Commit e27e962b authored by alexpott's avatar alexpott

Issue #2550407 by Berdir: Strict config schema breaks update tests, switch to...

Issue #2550407 by Berdir: Strict config schema breaks update tests, switch to testing the configuration at the end instead
parent 80715540
......@@ -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());
}
}
/**
......
......@@ -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.');
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment