diff -u b/core/modules/config/src/Tests/SchemaCheckTestTrait.php b/core/modules/config/src/Tests/SchemaCheckTestTrait.php --- b/core/modules/config/src/Tests/SchemaCheckTestTrait.php +++ b/core/modules/config/src/Tests/SchemaCheckTestTrait.php @@ -9,6 +9,7 @@ use Drupal\Core\Config\TypedConfigManagerInterface; use Drupal\Core\Config\Schema\SchemaCheckTrait; +use Drupal\Component\Utility\SafeMarkup; /** * Provides a class for checking configuration schema. @@ -32,19 +33,19 @@ if ($errors === FALSE) { // @todo Since the use of this trait is under TestBase, it works. // Can be fixed as part of https://www.drupal.org/node/2260053. - $this->fail("No schema for $config_name."); + $this->fail(SafeMarkup::format('No schema for @config_name', array('@config_name' => $config_name))); return; } elseif ($errors === TRUE) { // @todo Since the use of this trait is under TestBase, it works. // Can be fixed as part of https://www.drupal.org/node/2260053. - $this->pass("Schema found for $config_name."); + $this->pass(SafeMarkup::format('Schema found for @config_name and values comply with schema.', array('@config_name' => $config_name))); } else { foreach ($errors as $key => $error) { // @todo Since the use of this trait is under TestBase, it works. // Can be fixed as part of https://www.drupal.org/node/2260053. - $this->fail("Schema key $key failed with: $error."); + $this->fail(SafeMarkup::format('Schema key @key failed with: @error', array('@key' => $key, '@error' => $error))); } } } diff -u b/core/modules/field/src/Tests/FieldImportDeleteTest.php b/core/modules/field/src/Tests/FieldImportDeleteTest.php --- b/core/modules/field/src/Tests/FieldImportDeleteTest.php +++ b/core/modules/field/src/Tests/FieldImportDeleteTest.php @@ -7,6 +7,7 @@ namespace Drupal\field\Tests; +use Drupal\Component\Utility\SafeMarkup; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; @@ -64,11 +65,11 @@ $active = $this->container->get('config.storage'); $staging = $this->container->get('config.storage.staging'); $this->copyConfig($active, $staging); - $this->assertTrue($staging->delete($field_storage_config_name), "Deleted field storage: $field_storage_config_name"); - $this->assertTrue($staging->delete($field_storage_config_name_2), "Deleted field storage: $field_storage_config_name_2"); - $this->assertTrue($staging->delete($field_config_name), "Deleted field: $field_config_name"); - $this->assertTrue($staging->delete($field_config_name_2a), "Deleted field: $field_config_name_2a"); - $this->assertTrue($staging->delete($field_config_name_2b), "Deleted field: $field_config_name_2b"); + $this->assertTrue($staging->delete($field_storage_config_name), SafeMarkup::format('Deleted field storage: @field_storage', array('@field_storage' => $field_storage_config_name))); + $this->assertTrue($staging->delete($field_storage_config_name_2), SafeMarkup::format('Deleted field storage: @field_storage', array('@field_storage' => $field_storage_config_name_2))); + $this->assertTrue($staging->delete($field_config_name), SafeMarkup::format('Deleted field: @field', array('@field' => $field_config_name))); + $this->assertTrue($staging->delete($field_config_name_2a), SafeMarkup::format('Deleted field: @field', array('@field' => $field_config_name_2a))); + $this->assertTrue($staging->delete($field_config_name_2b), SafeMarkup::format('Deleted field: @field', array('@field' => $field_config_name_2b))); $deletes = $this->configImporter()->getUnprocessedConfiguration('delete'); $this->assertEqual(count($deletes), 5, 'Importing configuration will delete 3 fields and 2 field storages.');