Chris@0: checkConfigSchema($typed_config, $config_name, $config_data); Chris@0: if ($errors === FALSE) { Chris@0: // @todo Since the use of this trait is under TestBase, it works. Chris@0: // Can be fixed as part of https://www.drupal.org/node/2260053. Chris@17: $this->fail(new FormattableMarkup('No schema for @config_name', ['@config_name' => $config_name])); Chris@0: return; Chris@0: } Chris@0: elseif ($errors === TRUE) { Chris@0: // @todo Since the use of this trait is under TestBase, it works. Chris@0: // Can be fixed as part of https://www.drupal.org/node/2260053. Chris@17: $this->pass(new FormattableMarkup('Schema found for @config_name and values comply with schema.', ['@config_name' => $config_name])); Chris@0: } Chris@0: else { Chris@0: foreach ($errors as $key => $error) { Chris@0: // @todo Since the use of this trait is under TestBase, it works. Chris@0: // Can be fixed as part of https://www.drupal.org/node/2260053. Chris@17: $this->fail(new FormattableMarkup('Schema key @key failed with: @error', ['@key' => $key, '@error' => $error])); Chris@0: } Chris@0: } Chris@0: } Chris@0: Chris@0: /** Chris@0: * Asserts configuration, specified by name, has a valid schema. Chris@0: * Chris@0: * @param string $config_name Chris@0: * The configuration name. Chris@0: */ Chris@0: public function assertConfigSchemaByName($config_name) { Chris@0: $config = $this->config($config_name); Chris@0: $this->assertConfigSchema(\Drupal::service('config.typed'), $config->getName(), $config->get()); Chris@0: } Chris@0: Chris@0: }