Issue #3062556 by alexpott, phenaproxima: UpdatePathTestBase does not support the $configSchemaCheckerExclusions property

merge-requests/1119/head
catch 2019-06-19 15:45:53 +01:00
parent e56e16e156
commit 54f8eb66b5
2 changed files with 21 additions and 0 deletions

View File

@ -367,9 +367,17 @@ abstract class UpdatePathTestBase extends BrowserTestBase {
// 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();
// Allow tests to opt out of checking specific configuration.
$exclude = $this->getConfigSchemaExclusions();
/** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */
$typed_config = $this->container->get('config.typed');
foreach ($names as $name) {
if (in_array($name, $exclude, TRUE)) {
// Skip checking schema if the config is listed in the
// $configSchemaCheckerExclusions property.
continue;
}
$config = $this->config($name);
$this->assertConfigSchema($typed_config, $name, $config->get());
}

View File

@ -182,4 +182,17 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
$this->assertFalse(\Drupal::service('cache.default')->get(__CLASS__));
}
/**
* Tests that test running environment is updated when module list changes.
*
* @see update_test_schema_update_8003()
*/
public function testSchemaChecking() {
// Create some configuration that should be skipped.
$this->config('config_schema_test.noschema')->set('foo', 'bar')->save();
$this->runUpdates();
$this->assertSame('bar', $this->config('config_schema_test.noschema')->get('foo'));
}
}