From 570fba20cd55f8c5b3bff583f1a0188647368663 Mon Sep 17 00:00:00 2001 From: xjm <xjm@65776.no-reply.drupal.org> Date: Wed, 9 Sep 2015 19:04:37 -0500 Subject: [PATCH] Issue #2564353 by alexpott, joelpittet, xjm, justAChris, nlisgo, subhojit777: Remove !placeholder usage from SafeMarkup::format() --- .../lib/Drupal/Core/Config/ConfigImporter.php | 4 +- .../Core/Extension/InfoParserDynamic.php | 7 +-- .../src/Tests/CommentFieldAccessTest.php | 46 +++++++++---------- core/modules/config/src/Form/ConfigSync.php | 2 +- .../ConfigImportRenameValidationTest.php | 4 +- .../config/src/Tests/ConfigImporterTest.php | 3 +- .../config/src/Tests/SchemaCheckTestTrait.php | 4 +- .../field/src/Tests/FieldImportDeleteTest.php | 10 ++-- core/modules/locale/locale.pages.inc | 4 +- .../src/Tests/LocaleUpdateInterfaceTest.php | 2 +- .../Tests/NodeTypeRenameConfigImportTest.php | 2 +- core/modules/simpletest/src/TestBase.php | 6 +-- core/modules/simpletest/src/WebTestBase.php | 10 ++-- .../system/src/Tests/Module/UninstallTest.php | 4 +- .../src/Controller/CacheTestController.php | 2 +- 15 files changed, 53 insertions(+), 57 deletions(-) diff --git a/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php index e0d4e0d4b2ed..c02d4fe886ff 100644 --- a/core/lib/Drupal/Core/Config/ConfigImporter.php +++ b/core/lib/Drupal/Core/Config/ConfigImporter.php @@ -718,11 +718,11 @@ protected function validate() { $old_entity_type_id = $this->configManager->getEntityTypeIdByName($names['old_name']); $new_entity_type_id = $this->configManager->getEntityTypeIdByName($names['new_name']); if ($old_entity_type_id != $new_entity_type_id) { - $this->logError($this->t('Entity type mismatch on rename. !old_type not equal to !new_type for existing configuration !old_name and staged configuration !new_name.', array('old_type' => $old_entity_type_id, 'new_type' => $new_entity_type_id, 'old_name' => $names['old_name'], 'new_name' => $names['new_name']))); + $this->logError($this->t('Entity type mismatch on rename. @old_type not equal to @new_type for existing configuration @old_name and staged configuration @new_name.', array('@old_type' => $old_entity_type_id, '@new_type' => $new_entity_type_id, '@old_name' => $names['old_name'], '@new_name' => $names['new_name']))); } // Has to be a configuration entity. if (!$old_entity_type_id) { - $this->logError($this->t('Rename operation for simple configuration. Existing configuration !old_name and staged configuration !new_name.', array('old_name' => $names['old_name'], 'new_name' => $names['new_name']))); + $this->logError($this->t('Rename operation for simple configuration. Existing configuration @old_name and staged configuration @new_name.', array('@old_name' => $names['old_name'], '@new_name' => $names['new_name']))); } } $this->eventDispatcher->dispatch(ConfigEvents::IMPORT_VALIDATE, new ConfigImporterEvent($this)); diff --git a/core/lib/Drupal/Core/Extension/InfoParserDynamic.php b/core/lib/Drupal/Core/Extension/InfoParserDynamic.php index cf25594749c5..64e4941eb365 100644 --- a/core/lib/Drupal/Core/Extension/InfoParserDynamic.php +++ b/core/lib/Drupal/Core/Extension/InfoParserDynamic.php @@ -9,7 +9,6 @@ use Drupal\Component\Serialization\Yaml; use Drupal\Component\Serialization\Exception\InvalidDataTypeException; -use Drupal\Component\Utility\SafeMarkup; /** * Parses dynamic .info.yml files that might change during the page request. @@ -28,13 +27,11 @@ public function parse($filename) { $parsed_info = Yaml::decode(file_get_contents($filename)); } catch (InvalidDataTypeException $e) { - $message = SafeMarkup::format("Unable to parse !file: !error", array('!file' => $filename, '!error' => $e->getMessage())); - throw new InfoParserException($message); + throw new InfoParserException("Unable to parse $filename " . $e->getMessage()); } $missing_keys = array_diff($this->getRequiredKeys(), array_keys($parsed_info)); if (!empty($missing_keys)) { - $message = SafeMarkup::format('Missing required keys (!missing_keys) in !file.', array('!missing_keys' => implode(', ', $missing_keys), '!file' => $filename)); - throw new InfoParserException($message); + throw new InfoParserException('Missing required keys (' . implode(', ', $missing_keys) . ') in ' . $filename); } if (isset($parsed_info['version']) && $parsed_info['version'] === 'VERSION') { $parsed_info['version'] = \Drupal::VERSION; diff --git a/core/modules/comment/src/Tests/CommentFieldAccessTest.php b/core/modules/comment/src/Tests/CommentFieldAccessTest.php index ba1c0d380c0e..1f84bb5df5d6 100644 --- a/core/modules/comment/src/Tests/CommentFieldAccessTest.php +++ b/core/modules/comment/src/Tests/CommentFieldAccessTest.php @@ -213,17 +213,17 @@ public function testAccessToAdministrativeFields() { foreach ($permutations as $set) { $may_view = $set['comment']->{$field}->access('view', $set['user']); $may_update = $set['comment']->{$field}->access('edit', $set['user']); - $this->assertEqual($may_view, $set['user']->hasPermission('administer comments') || ($set['comment']->isPublished() && $set['user']->hasPermission('access comments')), SafeMarkup::format('User @user !state view field !field on comment @comment', [ + $this->assertEqual($may_view, $set['user']->hasPermission('administer comments') || ($set['comment']->isPublished() && $set['user']->hasPermission('access comments')), SafeMarkup::format('User @user @state view field @field on comment @comment', [ '@user' => $set['user']->getUsername(), - '!state' => $may_update ? 'can' : 'cannot', + '@state' => $may_update ? 'can' : 'cannot', '@comment' => $set['comment']->getSubject(), - '!field' => $field, + '@field' => $field, ])); - $this->assertEqual($may_update, $set['user']->hasPermission('administer comments'), SafeMarkup::format('User @user !state update field !field on comment @comment', [ + $this->assertEqual($may_update, $set['user']->hasPermission('administer comments'), SafeMarkup::format('User @user @state update field @field on comment @comment', [ '@user' => $set['user']->getUsername(), - '!state' => $may_update ? 'can' : 'cannot', + '@state' => $may_update ? 'can' : 'cannot', '@comment' => $set['comment']->getSubject(), - '!field' => $field, + '@field' => $field, ])); } } @@ -231,9 +231,9 @@ public function testAccessToAdministrativeFields() { // Check access to normal field. foreach ($permutations as $set) { $may_update = $set['comment']->access('update', $set['user']) && $set['comment']->subject->access('edit', $set['user']); - $this->assertEqual($may_update, $set['user']->hasPermission('administer comments') || ($set['user']->hasPermission('edit own comments') && $set['user']->id() == $set['comment']->getOwnerId()), SafeMarkup::format('User @user !state update field subject on comment @comment', [ + $this->assertEqual($may_update, $set['user']->hasPermission('administer comments') || ($set['user']->hasPermission('edit own comments') && $set['user']->id() == $set['comment']->getOwnerId()), SafeMarkup::format('User @user @state update field subject on comment @comment', [ '@user' => $set['user']->getUsername(), - '!state' => $may_update ? 'can' : 'cannot', + '@state' => $may_update ? 'can' : 'cannot', '@comment' => $set['comment']->getSubject(), ])); } @@ -245,17 +245,17 @@ public function testAccessToAdministrativeFields() { $may_view = $set['comment']->{$field}->access('view', $set['user']); $may_update = $set['comment']->{$field}->access('edit', $set['user']); $this->assertEqual($may_view, $field != 'hostname' && ($set['user']->hasPermission('administer comments') || - ($set['comment']->isPublished() && $set['user']->hasPermission('access comments'))), SafeMarkup::format('User @user !state view field !field on comment @comment', [ + ($set['comment']->isPublished() && $set['user']->hasPermission('access comments'))), SafeMarkup::format('User @user @state view field @field on comment @comment', [ '@user' => $set['user']->getUsername(), - '!state' => $may_view ? 'can' : 'cannot', + '@state' => $may_view ? 'can' : 'cannot', '@comment' => $set['comment']->getSubject(), - '!field' => $field, + '@field' => $field, ])); - $this->assertFalse($may_update, SafeMarkup::format('User @user !state update field !field on comment @comment', [ + $this->assertFalse($may_update, SafeMarkup::format('User @user @state update field @field on comment @comment', [ '@user' => $set['user']->getUsername(), - '!state' => $may_update ? 'can' : 'cannot', + '@state' => $may_update ? 'can' : 'cannot', '@comment' => $set['comment']->getSubject(), - '!field' => $field, + '@field' => $field, ])); } } @@ -267,17 +267,17 @@ public function testAccessToAdministrativeFields() { $may_view = $set['comment']->{$field}->access('view', $set['user']); $may_update = $set['comment']->{$field}->access('edit', $set['user']); $this->assertEqual($may_view, $field != 'hostname' && ($set['user']->hasPermission('administer comments') || - ($set['comment']->isPublished() && $set['user']->hasPermission('access comments'))), SafeMarkup::format('User @user !state view field !field on comment @comment', [ + ($set['comment']->isPublished() && $set['user']->hasPermission('access comments'))), SafeMarkup::format('User @user @state view field @field on comment @comment', [ '@user' => $set['user']->getUsername(), - '!state' => $may_view ? 'can' : 'cannot', + '@state' => $may_view ? 'can' : 'cannot', '@comment' => $set['comment']->getSubject(), - '!field' => $field, + '@field' => $field, ])); - $this->assertEqual($may_update, $set['user']->hasPermission('post comments') && $set['comment']->isNew(), SafeMarkup::format('User @user !state update field !field on comment @comment', [ + $this->assertEqual($may_update, $set['user']->hasPermission('post comments') && $set['comment']->isNew(), SafeMarkup::format('User @user @state update field @field on comment @comment', [ '@user' => $set['user']->getUsername(), - '!state' => $may_update ? 'can' : 'cannot', + '@state' => $may_update ? 'can' : 'cannot', '@comment' => $set['comment']->getSubject(), - '!field' => $field, + '@field' => $field, ])); } } @@ -295,11 +295,11 @@ public function testAccessToAdministrativeFields() { $set['comment']->isNew() && $set['user']->hasPermission('post comments') && $set['comment']->getFieldName() == 'comment_other' - ), SafeMarkup::format('User @user !state update field !field on comment @comment', [ + ), SafeMarkup::format('User @user @state update field @field on comment @comment', [ '@user' => $set['user']->getUsername(), - '!state' => $may_update ? 'can' : 'cannot', + '@state' => $may_update ? 'can' : 'cannot', '@comment' => $set['comment']->getSubject(), - '!field' => $field, + '@field' => $field, ])); } } diff --git a/core/modules/config/src/Form/ConfigSync.php b/core/modules/config/src/Form/ConfigSync.php index 7f240e30c099..19c12463f49a 100644 --- a/core/modules/config/src/Form/ConfigSync.php +++ b/core/modules/config/src/Form/ConfigSync.php @@ -277,7 +277,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { if ($config_change_type == 'rename') { $names = $storage_comparer->extractRenameNames($config_name); $route_options = array('source_name' => $names['old_name'], 'target_name' => $names['new_name']); - $config_name = $this->t('!source_name to !target_name', array('!source_name' => $names['old_name'], '!target_name' => $names['new_name'])); + $config_name = $this->t('@source_name to @target_name', array('@source_name' => $names['old_name'], '@target_name' => $names['new_name'])); } else { $route_options = array('source_name' => $config_name); diff --git a/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php b/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php index 118c1cb396d7..7f0d72e6d1bf 100644 --- a/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php +++ b/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php @@ -110,7 +110,7 @@ public function testRenameValidation() { catch (ConfigImporterException $e) { $this->pass('Expected ConfigImporterException thrown when a renamed configuration entity does not match the existing entity type.'); $expected = array( - SafeMarkup::format('Entity type mismatch on rename. !old_type not equal to !new_type for existing configuration !old_name and staged configuration !new_name.', array('old_type' => 'node_type', 'new_type' => 'config_test', 'old_name' => 'node.type.' . $content_type->id(), 'new_name' => 'config_test.dynamic.' . $test_entity_id)) + SafeMarkup::format('Entity type mismatch on rename. @old_type not equal to @new_type for existing configuration @old_name and staged configuration @new_name.', array('@old_type' => 'node_type', '@new_type' => 'config_test', '@old_name' => 'node.type.' . $content_type->id(), '@new_name' => 'config_test.dynamic.' . $test_entity_id)) ); $this->assertIdentical($expected, $this->configImporter->getErrors()); } @@ -153,7 +153,7 @@ public function testRenameSimpleConfigValidation() { catch (ConfigImporterException $e) { $this->pass('Expected ConfigImporterException thrown when simple configuration is renamed.'); $expected = array( - SafeMarkup::format('Rename operation for simple configuration. Existing configuration !old_name and staged configuration !new_name.', array('old_name' => 'config_test.old', 'new_name' => 'config_test.new')) + SafeMarkup::format('Rename operation for simple configuration. Existing configuration @old_name and staged configuration @new_name.', array('@old_name' => 'config_test.old', '@new_name' => 'config_test.new')) ); $this->assertIdentical($expected, $this->configImporter->getErrors()); } diff --git a/core/modules/config/src/Tests/ConfigImporterTest.php b/core/modules/config/src/Tests/ConfigImporterTest.php index ef90685b7da9..0e695bf3a5a8 100644 --- a/core/modules/config/src/Tests/ConfigImporterTest.php +++ b/core/modules/config/src/Tests/ConfigImporterTest.php @@ -295,8 +295,7 @@ function testSecondaryWriteSecondaryFirst() { $logs = $this->configImporter->getErrors(); $this->assertEqual(count($logs), 1); - $message = SafeMarkup::format("'config_test' entity with ID '@name' already exists", array('@name' => 'secondary')); - $this->assertEqual($logs[0], SafeMarkup::format('Unexpected error during import with operation @op for @name: !message.', array('@op' => 'create', '@name' => $name_primary, '!message' => $message))); + $this->assertEqual($logs[0], SafeMarkup::format("Unexpected error during import with operation @op for @name: 'config_test' entity with ID '@name_secondary' already exists.", array('@op' => 'create', '@name' => $name_primary, '@name_secondary' => 'secondary'))); } /** diff --git a/core/modules/config/src/Tests/SchemaCheckTestTrait.php b/core/modules/config/src/Tests/SchemaCheckTestTrait.php index c7dffe6e2091..c0823d561434 100644 --- a/core/modules/config/src/Tests/SchemaCheckTestTrait.php +++ b/core/modules/config/src/Tests/SchemaCheckTestTrait.php @@ -33,13 +33,13 @@ public function assertConfigSchema(TypedConfigManagerInterface $typed_config, $c 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(SafeMarkup::format('No schema for !config_name', array('!config_name' => $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(SafeMarkup::format('Schema found for !config_name and values comply with schema.', array('!config_name' => $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) { diff --git a/core/modules/field/src/Tests/FieldImportDeleteTest.php b/core/modules/field/src/Tests/FieldImportDeleteTest.php index 721d52ba0fe6..d4ffb05ae67e 100644 --- a/core/modules/field/src/Tests/FieldImportDeleteTest.php +++ b/core/modules/field/src/Tests/FieldImportDeleteTest.php @@ -65,11 +65,11 @@ public function testImportDelete() { $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), 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))); + $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.'); diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index d58d9557ca4b..c1b61c611e39 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -80,10 +80,10 @@ function template_preprocess_locale_translation_update_info(array &$variables) { if ($variables['not_found']) { foreach ($variables['not_found'] as $update) { $version = $update['version'] ? $update['version'] : t('no version'); - $releases[] = SafeMarkup::format('@module (@version). !info', array( + $releases[] = SafeMarkup::format('@module (@version). @info', array( '@module' => $update['name'], '@version' => $version, - '!info' => $update['info'], + '@info' => $update['info'], )); } } diff --git a/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php b/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php index bda7eec4a83a..dcade8668090 100644 --- a/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php +++ b/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php @@ -87,7 +87,7 @@ public function testInterface() { $this->assertRaw(t('Missing translations for: @languages. See the <a href="@updates">Available translation updates</a> page for more information.', array('@languages' => t('German'), '@updates' => \Drupal::url('locale.translate_status'))), 'Missing translations message'); $this->drupalGet('admin/reports/translations'); $this->assertText(t('Missing translations for one project'), 'No translations found'); - $this->assertText(SafeMarkup::format('@module (@version). !info', array('@module' => 'Locale test translate', '@version' => '1.3-dev', '!info' => t('No translation files are provided for development releases.'))), 'Release details'); + $this->assertText(SafeMarkup::format('@module (@version). @info', array('@module' => 'Locale test translate', '@version' => '1.3-dev', '@info' => t('No translation files are provided for development releases.'))), 'Release details'); $this->assertText(t('No translation files are provided for development releases.'), 'Release info'); // Override Drupal core translation status as 'no translations found'. diff --git a/core/modules/node/src/Tests/NodeTypeRenameConfigImportTest.php b/core/modules/node/src/Tests/NodeTypeRenameConfigImportTest.php index af29bce89c4f..75e4f0da7c75 100644 --- a/core/modules/node/src/Tests/NodeTypeRenameConfigImportTest.php +++ b/core/modules/node/src/Tests/NodeTypeRenameConfigImportTest.php @@ -104,7 +104,7 @@ public function testConfigurationRename() { $this->drupalGet('admin/config/development/configuration'); foreach ($expected as $rename) { $names = $this->configImporter()->getStorageComparer()->extractRenameNames($rename); - $this->assertText(SafeMarkup::format('!source_name to !target_name', array('!source_name' => $names['old_name'], '!target_name' => $names['new_name']))); + $this->assertText(SafeMarkup::format('@source_name to @target_name', array('@source_name' => $names['old_name'], '@target_name' => $names['new_name']))); // Test that the diff link is present for each renamed item. $href = \Drupal::urlGenerator()->getPathFromRoute('config.diff', array('source_name' => $names['old_name'], 'target_name' => $names['new_name'])); $this->assertLinkByHref($href); diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php index 1e59712bf8f4..acc8c81e123f 100644 --- a/core/modules/simpletest/src/TestBase.php +++ b/core/modules/simpletest/src/TestBase.php @@ -754,9 +754,9 @@ protected function assertNotIdentical($first, $second, $message = '', $group = ' * TRUE if the assertion succeeded, FALSE otherwise. */ protected function assertIdenticalObject($object1, $object2, $message = '', $group = 'Other') { - $message = $message ?: SafeMarkup::format('!object1 is identical to !object2', array( - '!object1' => var_export($object1, TRUE), - '!object2' => var_export($object2, TRUE), + $message = $message ?: SafeMarkup::format('@object1 is identical to @object2', array( + '@object1' => var_export($object1, TRUE), + '@object2' => var_export($object2, TRUE), )); $identical = TRUE; foreach ($object1 as $key => $value) { diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index 905fb3ead89d..ecbf3fe9b329 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -1419,12 +1419,12 @@ protected function curlExec($curl_options, $redirect = FALSE) { $this->url = isset($original_url) ? $original_url : curl_getinfo($this->curlHandle, CURLINFO_EFFECTIVE_URL); $message_vars = array( - '!method' => !empty($curl_options[CURLOPT_NOBODY]) ? 'HEAD' : (empty($curl_options[CURLOPT_POSTFIELDS]) ? 'GET' : 'POST'), + '@method' => !empty($curl_options[CURLOPT_NOBODY]) ? 'HEAD' : (empty($curl_options[CURLOPT_POSTFIELDS]) ? 'GET' : 'POST'), '@url' => isset($original_url) ? $original_url : $url, '@status' => $status, - '!length' => format_size(strlen($this->getRawContent())) + '@length' => format_size(strlen($this->getRawContent())) ); - $message = SafeMarkup::format('!method @url returned @status (!length).', $message_vars); + $message = SafeMarkup::format('@method @url returned @status (@length).', $message_vars); $this->assertTrue($this->getRawContent() !== FALSE, $message, 'Browser'); return $this->getRawContent(); } @@ -2718,7 +2718,7 @@ protected function assertUrl($path, array $options = array(), $message = '', $gr protected function assertResponse($code, $message = '', $group = 'Browser') { $curl_code = curl_getinfo($this->curlHandle, CURLINFO_HTTP_CODE); $match = is_array($code) ? in_array($curl_code, $code) : $curl_code == $code; - return $this->assertTrue($match, $message ? $message : SafeMarkup::format('HTTP response expected !code, actual !curl_code', array('!code' => $code, '!curl_code' => $curl_code)), $group); + return $this->assertTrue($match, $message ? $message : SafeMarkup::format('HTTP response expected @code, actual @curl_code', array('@code' => $code, '@curl_code' => $curl_code)), $group); } /** @@ -2744,7 +2744,7 @@ protected function assertResponse($code, $message = '', $group = 'Browser') { protected function assertNoResponse($code, $message = '', $group = 'Browser') { $curl_code = curl_getinfo($this->curlHandle, CURLINFO_HTTP_CODE); $match = is_array($code) ? in_array($curl_code, $code) : $curl_code == $code; - return $this->assertFalse($match, $message ? $message : SafeMarkup::format('HTTP response not expected !code, actual !curl_code', array('!code' => $code, '!curl_code' => $curl_code)), $group); + return $this->assertFalse($match, $message ? $message : SafeMarkup::format('HTTP response not expected @code, actual @curl_code', array('@code' => $code, '@curl_code' => $curl_code)), $group); } /** diff --git a/core/modules/system/src/Tests/Module/UninstallTest.php b/core/modules/system/src/Tests/Module/UninstallTest.php index 4b8df60cd72a..253ea18549ba 100644 --- a/core/modules/system/src/Tests/Module/UninstallTest.php +++ b/core/modules/system/src/Tests/Module/UninstallTest.php @@ -72,7 +72,7 @@ function testUninstallPage() { $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall')); $this->assertNoText(\Drupal::translation()->translate('Configuration deletions'), 'No configuration deletions listed on the module install confirmation page.'); $this->assertText(\Drupal::translation()->translate('Configuration updates'), 'Configuration updates listed on the module install confirmation page.'); - $this->assertText($node_type->label(), SafeMarkup::format('The entity label "!label" found.', array('!label' => $node_type->label()))); + $this->assertText($node_type->label()); $this->drupalPostForm(NULL, NULL, t('Uninstall')); $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.'); @@ -88,7 +88,7 @@ function testUninstallPage() { $entity_types = array(); foreach ($node_dependencies as $entity) { $label = $entity->label() ?: $entity->id(); - $this->assertText($label, SafeMarkup::format('The entity label "!label" found.', array('!label' => $label))); + $this->assertText($label); $entity_types[] = $entity->getEntityTypeId(); } $entity_types = array_unique($entity_types); diff --git a/core/modules/system/tests/modules/cache_test/src/Controller/CacheTestController.php b/core/modules/system/tests/modules/cache_test/src/Controller/CacheTestController.php index 78c29b3ed024..f47c0573351c 100644 --- a/core/modules/system/tests/modules/cache_test/src/Controller/CacheTestController.php +++ b/core/modules/system/tests/modules/cache_test/src/Controller/CacheTestController.php @@ -22,7 +22,7 @@ class CacheTestController { public function urlBubbling() { $url = Url::fromRoute('<current>')->setAbsolute(); return [ - '#markup' => SafeMarkup::format('This URL is early-rendered: !url. Yet, its bubbleable metadata should be bubbled.', ['!url' => $url->toString()]) + '#markup' => 'This URL is early-rendered: ' . $url->toString() . '. Yet, its bubbleable metadata should be bubbled.', ]; } -- GitLab