From 54f8eb66b5314a8037a1788369cf94f33d1dbaac Mon Sep 17 00:00:00 2001 From: catch Date: Wed, 19 Jun 2019 15:45:53 +0100 Subject: [PATCH] Issue #3062556 by alexpott, phenaproxima: UpdatePathTestBase does not support the $configSchemaCheckerExclusions property --- .../FunctionalTests/Update/UpdatePathTestBase.php | 8 ++++++++ .../Update/UpdatePathTestBaseTest.php | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php index af27c7de571f..af7b362f1071 100644 --- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php +++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php @@ -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()); } diff --git a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php index 1d7462d7571d..fce0811e8e62 100644 --- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php +++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php @@ -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')); + + } + }