diff --git a/core/modules/block_content/src/Tests/BlockContentTypeTest.php b/core/modules/block_content/src/Tests/BlockContentTypeTest.php index d1405b9..485368b 100644 --- a/core/modules/block_content/src/Tests/BlockContentTypeTest.php +++ b/core/modules/block_content/src/Tests/BlockContentTypeTest.php @@ -116,7 +116,7 @@ public function testBlockContentTypeEditing() { 'label' => 'Bar', ); $this->drupalGet('admin/structure/block/block-content/manage/basic'); - $this->assertTitle(format_string('Edit @type custom block type | Drupal', ['@type' => 'basic'])); + $this->assertTitle('Edit basic custom block type | Drupal'); $this->drupalPostForm(NULL, $edit, t('Save')); \Drupal::entityManager()->clearCachedFieldDefinitions(); diff --git a/core/modules/config/src/Tests/ConfigEntityTest.php b/core/modules/config/src/Tests/ConfigEntityTest.php index 13ab721..ff18888 100644 --- a/core/modules/config/src/Tests/ConfigEntityTest.php +++ b/core/modules/config/src/Tests/ConfigEntityTest.php @@ -241,9 +241,9 @@ function testCRUDUI() { $label1 = $this->randomMachineName(); $label2 = $this->randomMachineName(); $label3 = $this->randomMachineName(); - $message_insert = format_string('%label configuration has been created.', array('%label' => $label1)); - $message_update = format_string('%label configuration has been updated.', array('%label' => $label2)); - $message_delete = format_string('The test configuration %label has been deleted.', array('%label' => $label2)); + $message_insert = '' . $label1 . ' configuration has been created.'; + $message_update = '' . $label2 . ' configuration has been updated.'; + $message_delete = 'The test configuration ' . $label2 . ' has been deleted.'; // Create a configuration entity. $edit = array( @@ -314,7 +314,7 @@ function testCRUDUI() { ); $this->drupalPostForm('admin/structure/config_test/add', $edit, 'Save'); $this->assertResponse(200); - $message_insert = format_string('%label configuration has been created.', array('%label' => $edit['label'])); + $message_insert = '' . $edit['label'] . ' configuration has been created.'; $this->assertRaw($message_insert); $this->assertLinkByHref('admin/structure/config_test/manage/0'); $this->assertLinkByHref('admin/structure/config_test/manage/0/delete'); diff --git a/core/modules/contact/src/Tests/ContactPersonalTest.php b/core/modules/contact/src/Tests/ContactPersonalTest.php index d133240..176beea 100644 --- a/core/modules/contact/src/Tests/ContactPersonalTest.php +++ b/core/modules/contact/src/Tests/ContactPersonalTest.php @@ -95,12 +95,7 @@ function testSendPersonalContactMessage() { $this->drupalLogin($this->adminUser); // Verify that the correct watchdog message has been logged. $this->drupalGet('/admin/reports/dblog'); - $placeholders = array( - '@sender_name' => $this->webUser->username, - '@sender_email' => $this->webUser->getEmail(), - '@recipient_name' => $this->contactUser->getUsername() - ); - $this->assertRaw(SafeMarkup::format('@sender_name (@sender_email) sent @recipient_name an email.', $placeholders)); + $this->assertRaw($this->webUser->username . ' (' . $this->webUser->getEmail() . ') sent ' . $this->contactUser->getUsername() . ' an email.'); // Ensure an unescaped version of the email does not exist anywhere. $this->assertNoRaw($this->webUser->getEmail()); } diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php index 39cd34a..15a8cf2 100644 --- a/core/modules/contact/src/Tests/ContactSitewideTest.php +++ b/core/modules/contact/src/Tests/ContactSitewideTest.php @@ -130,7 +130,7 @@ function testSiteWideContact() { $max_length = EntityTypeInterface::BUNDLE_MAX_LENGTH; $max_length_exceeded = $max_length + 1; $this->addContactForm($id = Unicode::strtolower($this->randomMachineName($max_length_exceeded)), $label = $this->randomMachineName($max_length_exceeded), implode(',', array($recipients[0])), '', TRUE); - $this->assertText(format_string('Machine-readable name cannot be longer than @max characters but is currently @exceeded characters long.', array('@max' => $max_length, '@exceeded' => $max_length_exceeded))); + $this->assertText('Machine-readable name cannot be longer than ' . $max_length . ' characters but is currently @' . $max_length_exceeded . ' characters long.'); $this->addContactForm($id = Unicode::strtolower($this->randomMachineName($max_length)), $label = $this->randomMachineName($max_length), implode(',', array($recipients[0])), '', TRUE); $this->assertRaw(t('Contact form %label has been added.', array('%label' => $label))); diff --git a/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php b/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php index 8c5146b..8f097ea 100644 --- a/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php +++ b/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php @@ -95,10 +95,6 @@ function testBooleanFormatterSettings() { 'Custom', ); - // Define what the "default" option should look like, depending on the - // field settings. - $default = 'Field settings (@on / @off)'; - // For several different values of the field settings, test that the // options, including default, are shown correctly. $settings = array( @@ -123,7 +119,7 @@ function testBooleanFormatterSettings() { foreach ($options as $string) { $this->assertText($string); } - $this->assertText(SafeMarkup::format($default, array('@on' => $values[0], '@off' => $values[1]))); + $this->assertText('Field settings (' . $values[0] . ' / ' . $values[1] . ')'); } } diff --git a/core/modules/field/src/Tests/String/StringFieldTest.php b/core/modules/field/src/Tests/String/StringFieldTest.php index 3114490..e837ad1 100644 --- a/core/modules/field/src/Tests/String/StringFieldTest.php +++ b/core/modules/field/src/Tests/String/StringFieldTest.php @@ -81,7 +81,7 @@ function _testTextfieldWidgets($field_type, $widget_type) { $this->drupalGet('entity_test/add'); $this->assertFieldByName("{$field_name}[0][value]", '', 'Widget is displayed'); $this->assertNoFieldByName("{$field_name}[0][format]", '1', 'Format selector is not displayed'); - $this->assertRaw(format_string('placeholder="A placeholder on @widget_type"', array('@widget_type' => $widget_type))); + $this->assertRaw('placeholder="A placeholder on ' . $widget_type . '"'); // Submit with some value. $value = $this->randomMachineName(); diff --git a/core/modules/field/src/Tests/Timestamp/TimestampFormatterTest.php b/core/modules/field/src/Tests/Timestamp/TimestampFormatterTest.php index 2323b15..c954bb4 100644 --- a/core/modules/field/src/Tests/Timestamp/TimestampFormatterTest.php +++ b/core/modules/field/src/Tests/Timestamp/TimestampFormatterTest.php @@ -161,6 +161,7 @@ protected function testTimestampAgoFormatter() { // Test a timestamp in the past $value = $request_time - 87654321; + // @todo $expected = SafeMarkup::format($past_format, ['@interval' => \Drupal::service('date.formatter')->formatTimeDiffSince($value, ['granularity' => $granularity])]); $component = $this->display->getComponent($this->fieldName); @@ -176,6 +177,7 @@ protected function testTimestampAgoFormatter() { // Test a timestamp in the future $value = $request_time + 87654321; + // @todo $expected = SafeMarkup::format($future_format, ['@interval' => \Drupal::service('date.formatter')->formatTimeDiffUntil($value, ['granularity' => $granularity])]); $component = $this->display->getComponent($this->fieldName); diff --git a/core/modules/field_ui/src/Tests/ManageFieldsTest.php b/core/modules/field_ui/src/Tests/ManageFieldsTest.php index 8cc6e43..11e2a07 100644 --- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php +++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php @@ -363,7 +363,7 @@ function testFieldPrefix() { // Create a valid field. $this->fieldUIAddNewField('admin/structure/types/manage/' . $this->contentType, $this->fieldNameInput, $this->fieldLabel); $this->drupalGet('admin/structure/types/manage/' . $this->contentType . '/fields/node.' . $this->contentType . '.' . $field_prefix . $this->fieldNameInput); - $this->assertText(format_string('@label settings for @type', array('@label' => $this->fieldLabel, '@type' => $this->contentType))); + $this->assertText($this->fieldLabel . ' settings for ' . $this->contentType); } /** diff --git a/core/modules/file/src/Tests/FilePrivateTest.php b/core/modules/file/src/Tests/FilePrivateTest.php index a11c81a..36e0ec2 100644 --- a/core/modules/file/src/Tests/FilePrivateTest.php +++ b/core/modules/file/src/Tests/FilePrivateTest.php @@ -85,6 +85,7 @@ function testPrivateFile() { $this->assertUrl('node/' . $new_node->id() .'/edit'); // Check that we got the expected constraint form error. $constraint = new ReferenceAccessConstraint(); + // @todo $this->assertRaw(SafeMarkup::format($constraint->message, array('%type' => 'file', '%id' => $node_file->id()))); // Attempt to reuse the existing file when creating a new node, and confirm // that access is still denied. @@ -95,6 +96,7 @@ function testPrivateFile() { $new_node = $this->drupalGetNodeByTitle($edit['title[0][value]']); $this->assertTrue(empty($new_node), 'Node was not created.'); $this->assertUrl('node/add/' . $type_name); + // @todo $this->assertRaw(SafeMarkup::format($constraint->message, array('%type' => 'file', '%id' => $node_file->id()))); // Now make file_test_file_download() return everything. diff --git a/core/modules/node/src/Tests/Views/BulkFormAccessTest.php b/core/modules/node/src/Tests/Views/BulkFormAccessTest.php index fa8a527..c9d24f4 100644 --- a/core/modules/node/src/Tests/Views/BulkFormAccessTest.php +++ b/core/modules/node/src/Tests/Views/BulkFormAccessTest.php @@ -93,6 +93,7 @@ public function testNodeEditAccess() { 'action' => 'node_unpublish_action', ); $this->drupalPostForm('test-node-bulk-form', $edit, t('Apply')); + // @todo $this->assertRaw(SafeMarkup::format('No access to execute %action on the @entity_type_label %entity_label.', [ '%action' => 'Unpublish content', '@entity_type_label' => 'Content', diff --git a/core/modules/options/src/Tests/OptionsFieldUITest.php b/core/modules/options/src/Tests/OptionsFieldUITest.php index d4219c6..6c381fe 100644 --- a/core/modules/options/src/Tests/OptionsFieldUITest.php +++ b/core/modules/options/src/Tests/OptionsFieldUITest.php @@ -326,7 +326,7 @@ function testNodeDisplay() { ); $this->drupalPostForm($this->adminPath, $edit, t('Save field settings')); - $this->assertText(format_string('Updated field @field_name field settings.', array('@field_name' => $this->fieldName)), "The 'On' and 'Off' form fields work for boolean fields."); + $this->assertText('Updated field ' . $this->fieldName . ' field settings.', "The 'On' and 'Off' form fields work for boolean fields."); // Select a default value. $edit = array( diff --git a/core/modules/system/src/Tests/Entity/EntityOperationsTest.php b/core/modules/system/src/Tests/Entity/EntityOperationsTest.php index c7aeb7c..55f9021 100644 --- a/core/modules/system/src/Tests/Entity/EntityOperationsTest.php +++ b/core/modules/system/src/Tests/Entity/EntityOperationsTest.php @@ -41,7 +41,7 @@ public function testEntityOperationAlter() { $roles = user_roles(); foreach ($roles as $role) { $this->assertLinkByHref($role->url() . '/test_operation'); - $this->assertLink(format_string('Test Operation: @label', array('@label' => $role->label()))); + $this->assertLink('Test Operation: ' . $role->label()); } } diff --git a/core/modules/system/src/Tests/System/AccessDeniedTest.php b/core/modules/system/src/Tests/System/AccessDeniedTest.php index b068802..111dec9 100644 --- a/core/modules/system/src/Tests/System/AccessDeniedTest.php +++ b/core/modules/system/src/Tests/System/AccessDeniedTest.php @@ -51,6 +51,7 @@ function testAccessDenied() { 'site_403' => 'user/' . $this->adminUser->id(), ]; $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); + // @todo $this->assertRaw(SafeMarkup::format("The path '%path' has to start with a slash.", ['%path' => $edit['site_403']])); // Use a custom 403 page. diff --git a/core/modules/system/src/Tests/System/FrontPageTest.php b/core/modules/system/src/Tests/System/FrontPageTest.php index e5527d9..3d34849 100644 --- a/core/modules/system/src/Tests/System/FrontPageTest.php +++ b/core/modules/system/src/Tests/System/FrontPageTest.php @@ -75,6 +75,7 @@ public function testDrupalFrontPage() { // Change the front page to a path without a starting slash. $edit = ['site_frontpage' => $this->nodePath]; $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); + // @todo $this->assertRaw(SafeMarkup::format("The path '%path' has to start with a slash.", ['%path' => $edit['site_frontpage']])); // Change the front page to a valid path. diff --git a/core/modules/system/src/Tests/System/PageNotFoundTest.php b/core/modules/system/src/Tests/System/PageNotFoundTest.php index b7c0609..97da608 100644 --- a/core/modules/system/src/Tests/System/PageNotFoundTest.php +++ b/core/modules/system/src/Tests/System/PageNotFoundTest.php @@ -39,6 +39,7 @@ function testPageNotFound() { 'site_404' => 'user/' . $this->adminUser->id(), ]; $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); + // @todo $this->assertRaw(SafeMarkup::format("The path '%path' has to start with a slash.", ['%path' => $edit['site_404']])); // Use a custom 404 page. diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php index 815b95e..e058abf 100644 --- a/core/modules/user/src/Tests/UserRegistrationTest.php +++ b/core/modules/user/src/Tests/UserRegistrationTest.php @@ -280,6 +280,7 @@ public function testUniqueFields() { $edit = ['mail' => $account->getEmail(), 'name' => $this->randomString()]; $this->drupalPostForm('user/register', $edit, t('Create new account')); + // @todo $this->assertRaw(SafeMarkup::format('The email address %value is already taken.', ['%value' => $account->getEmail()])); } diff --git a/core/modules/user/src/Tests/Views/BulkFormAccessTest.php b/core/modules/user/src/Tests/Views/BulkFormAccessTest.php index d59f6b9..cd4b468 100644 --- a/core/modules/user/src/Tests/Views/BulkFormAccessTest.php +++ b/core/modules/user/src/Tests/Views/BulkFormAccessTest.php @@ -58,6 +58,7 @@ public function testUserEditAccess() { $this->drupalPostForm('test-user-bulk-form', $edit, t('Apply')); $this->assertResponse(200); + // @todo $this->assertRaw(SafeMarkup::format('No access to execute %action on the @entity_type_label %entity_label.', [ '%action' => 'Block the selected user(s)', '@entity_type_label' => 'User', diff --git a/core/modules/views_ui/src/Tests/HandlerTest.php b/core/modules/views_ui/src/Tests/HandlerTest.php index 0394f10..363b5f0 100644 --- a/core/modules/views_ui/src/Tests/HandlerTest.php +++ b/core/modules/views_ui/src/Tests/HandlerTest.php @@ -228,6 +228,7 @@ public function testBrokenHandlers() { ]; foreach ($original_configuration as $key => $value) { + // @todo $this->assertText(SafeMarkup::format('@key: @value', array('@key' => $key, '@value' => $value))); } }