Mercurial > hg > isophonics-drupal-site
comparison core/tests/Drupal/Tests/SchemaCheckTestTrait.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
2 | 2 |
3 namespace Drupal\Tests; | 3 namespace Drupal\Tests; |
4 | 4 |
5 use Drupal\Core\Config\TypedConfigManagerInterface; | 5 use Drupal\Core\Config\TypedConfigManagerInterface; |
6 use Drupal\Core\Config\Schema\SchemaCheckTrait; | 6 use Drupal\Core\Config\Schema\SchemaCheckTrait; |
7 use Drupal\Component\Utility\SafeMarkup; | 7 use Drupal\Component\Render\FormattableMarkup; |
8 | 8 |
9 /** | 9 /** |
10 * Provides a class for checking configuration schema. | 10 * Provides a class for checking configuration schema. |
11 */ | 11 */ |
12 trait SchemaCheckTestTrait { | 12 trait SchemaCheckTestTrait { |
26 public function assertConfigSchema(TypedConfigManagerInterface $typed_config, $config_name, $config_data) { | 26 public function assertConfigSchema(TypedConfigManagerInterface $typed_config, $config_name, $config_data) { |
27 $errors = $this->checkConfigSchema($typed_config, $config_name, $config_data); | 27 $errors = $this->checkConfigSchema($typed_config, $config_name, $config_data); |
28 if ($errors === FALSE) { | 28 if ($errors === FALSE) { |
29 // @todo Since the use of this trait is under TestBase, it works. | 29 // @todo Since the use of this trait is under TestBase, it works. |
30 // Can be fixed as part of https://www.drupal.org/node/2260053. | 30 // Can be fixed as part of https://www.drupal.org/node/2260053. |
31 $this->fail(SafeMarkup::format('No schema for @config_name', ['@config_name' => $config_name])); | 31 $this->fail(new FormattableMarkup('No schema for @config_name', ['@config_name' => $config_name])); |
32 return; | 32 return; |
33 } | 33 } |
34 elseif ($errors === TRUE) { | 34 elseif ($errors === TRUE) { |
35 // @todo Since the use of this trait is under TestBase, it works. | 35 // @todo Since the use of this trait is under TestBase, it works. |
36 // Can be fixed as part of https://www.drupal.org/node/2260053. | 36 // Can be fixed as part of https://www.drupal.org/node/2260053. |
37 $this->pass(SafeMarkup::format('Schema found for @config_name and values comply with schema.', ['@config_name' => $config_name])); | 37 $this->pass(new FormattableMarkup('Schema found for @config_name and values comply with schema.', ['@config_name' => $config_name])); |
38 } | 38 } |
39 else { | 39 else { |
40 foreach ($errors as $key => $error) { | 40 foreach ($errors as $key => $error) { |
41 // @todo Since the use of this trait is under TestBase, it works. | 41 // @todo Since the use of this trait is under TestBase, it works. |
42 // Can be fixed as part of https://www.drupal.org/node/2260053. | 42 // Can be fixed as part of https://www.drupal.org/node/2260053. |
43 $this->fail(SafeMarkup::format('Schema key @key failed with: @error', ['@key' => $key, '@error' => $error])); | 43 $this->fail(new FormattableMarkup('Schema key @key failed with: @error', ['@key' => $key, '@error' => $error])); |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 /** | 48 /** |