Commit 5939e6b5 authored by catch's avatar catch

Issue #3145418 by longwave, paulocs, shetpooja04, Spokje, nikitagupta,...

Issue #3145418 by longwave, paulocs, shetpooja04, Spokje, nikitagupta, mondrake, ravi.shankar, sarvjeetsingh, mrinalini9: [November 9, 2020] Remove uses of t() in assertText() calls
parent 4397d8d5
......@@ -52,7 +52,7 @@ public function testActionConfiguration() {
$action_id = $edit['id'];
// Make sure that the new complex action was saved properly.
$this->assertText(t('The action has been successfully saved.'), "Make sure we get a confirmation that we've successfully saved the complex action.");
$this->assertText('The action has been successfully saved.', "Make sure we get a confirmation that we've successfully saved the complex action.");
$this->assertText($action_label, "Make sure the action label appears on the configuration page after we've saved the complex action.");
// Make another POST request to the action edit page.
......@@ -66,7 +66,7 @@ public function testActionConfiguration() {
$this->assertSession()->statusCodeEquals(200);
// Make sure that the action updated properly.
$this->assertText(t('The action has been successfully saved.'), "Make sure we get a confirmation that we've successfully updated the complex action.");
$this->assertText('The action has been successfully saved.', "Make sure we get a confirmation that we've successfully updated the complex action.");
$this->assertNoText($action_label, "Make sure the old action label does NOT appear on the configuration page after we've updated the complex action.");
$this->assertText($new_action_label, "Make sure the action label appears on the configuration page after we've updated the complex action.");
......
......@@ -37,7 +37,7 @@ public function testSettingsPage() {
'aggregator_processors[aggregator_test_processor]' => 'aggregator_test_processor',
];
$this->drupalPostForm('admin/config/services/aggregator/settings', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'));
$this->assertText('The configuration options have been saved.');
// Check that settings have the correct default value.
foreach ($edit as $name => $value) {
......@@ -45,13 +45,13 @@ public function testSettingsPage() {
}
// Check for our test processor settings form.
$this->assertText(t('Dummy length setting'));
$this->assertText('Dummy length setting');
// Change its value to ensure that settingsSubmit is called.
$edit = [
'dummy_length' => 100,
];
$this->drupalPostForm('admin/config/services/aggregator/settings', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'));
$this->assertText('The configuration options have been saved.');
$this->assertSession()->fieldValueEquals('dummy_length', 100);
// Make sure settings form is still accessible even after uninstalling a module
......
......@@ -75,7 +75,7 @@ protected function setUp() {
public function createFeed($feed_url = NULL, array $edit = []) {
$edit = $this->getFeedEditArray($feed_url, $edit);
$this->drupalPostForm('aggregator/sources/add', $edit, t('Save'));
$this->assertText(t('The feed @name has been added.', ['@name' => $edit['title[0][value]']]), new FormattableMarkup('The feed @name has been added.', ['@name' => $edit['title[0][value]']]));
$this->assertText('The feed ' . Html::escape($edit['title[0][value]']) . ' has been added.', new FormattableMarkup('The feed @name has been added.', ['@name' => $edit['title[0][value]']]));
// Verify that the creation message contains a link to a feed.
$this->assertSession()->elementExists('xpath', '//div[@data-drupal-messages]//a[contains(@href, "aggregator/sources/")]');
......
......@@ -74,7 +74,7 @@ public function validateImportFormFields() {
$edit = ['remote' => 'invalidUrl://empty'];
$this->drupalPostForm('admin/config/services/aggregator/add/opml', $edit, t('Import'));
$this->assertText(t('The URL invalidUrl://empty is not valid.'), 'Error if the URL is invalid.');
$this->assertText('The URL invalidUrl://empty is not valid.', 'Error if the URL is invalid.');
$after = $count_query->execute();
$this->assertEqual($before, $after, 'No feeds were added during the three last form submissions.');
......@@ -89,11 +89,11 @@ protected function submitImportForm() {
$form['files[upload]'] = $this->getInvalidOpml();
$this->drupalPostForm('admin/config/services/aggregator/add/opml', $form, t('Import'));
$this->assertText(t('No new feed has been added.'), 'Attempting to upload invalid XML.');
$this->assertText('No new feed has been added.', 'Attempting to upload invalid XML.');
$edit = ['remote' => file_create_url($this->getEmptyOpml())];
$this->drupalPostForm('admin/config/services/aggregator/add/opml', $edit, t('Import'));
$this->assertText(t('No new feed has been added.'), 'Attempting to load empty OPML from remote URL.');
$this->assertText('No new feed has been added.', 'Attempting to load empty OPML from remote URL.');
$after = $count_query->execute();
$this->assertEqual($before, $after, 'No feeds were added during the two last form submissions.');
......
......@@ -44,7 +44,7 @@ public function testUpdateFeedItem() {
$this->assertSession()->statusCodeEquals(200);
$this->drupalPostForm('aggregator/sources/add', $edit, t('Save'));
$this->assertText(t('The feed @name has been added.', ['@name' => $edit['title[0][value]']]), new FormattableMarkup('The feed @name has been added.', ['@name' => $edit['title[0][value]']]));
$this->assertText('The feed ' . $edit['title[0][value]'] . ' has been added.', new FormattableMarkup('The feed @name has been added.', ['@name' => $edit['title[0][value]']]));
// Verify that the creation message contains a link to a feed.
$this->assertSession()->elementExists('xpath', '//div[@data-drupal-messages]//a[contains(@href, "aggregator/sources/")]');
......
......@@ -32,7 +32,7 @@ public function testUpdateFeed() {
$edit[$same_field] = $feed->{$same_field}->value;
}
$this->drupalPostForm('aggregator/sources/' . $feed->id() . '/configure', $edit, t('Save'));
$this->assertText(t('The feed @name has been updated.', ['@name' => $edit['title[0][value]']]), new FormattableMarkup('The feed %name has been updated.', ['%name' => $edit['title[0][value]']]));
$this->assertText('The feed ' . $edit['title[0][value]'] . ' has been updated.', new FormattableMarkup('The feed %name has been updated.', ['%name' => $edit['title[0][value]']]));
// Verify that the creation message contains a link to a feed.
$this->assertSession()->elementExists('xpath', '//div[@data-drupal-messages]//a[contains(@href, "aggregator/sources/")]');
......
......@@ -47,25 +47,25 @@ public function testIPAddressValidation() {
$edit = [];
$edit['ip'] = '1.2.3.3';
$this->drupalPostForm('admin/config/people/ban', $edit, t('Add'));
$this->assertText(t('This IP address is already banned.'));
$this->assertText('This IP address is already banned.');
// Try to block a reserved IP address.
$edit = [];
$edit['ip'] = '255.255.255.255';
$this->drupalPostForm('admin/config/people/ban', $edit, t('Add'));
$this->assertText(t('Enter a valid IP address.'));
$this->assertText('Enter a valid IP address.');
// Try to block a reserved IP address.
$edit = [];
$edit['ip'] = 'test.example.com';
$this->drupalPostForm('admin/config/people/ban', $edit, t('Add'));
$this->assertText(t('Enter a valid IP address.'));
$this->assertText('Enter a valid IP address.');
// Submit an empty form.
$edit = [];
$edit['ip'] = '';
$this->drupalPostForm('admin/config/people/ban', $edit, t('Add'));
$this->assertText(t('Enter a valid IP address.'));
$this->assertText('Enter a valid IP address.');
// Pass an IP address as a URL parameter and submit it.
$submit_ip = '1.2.3.4';
......@@ -80,7 +80,7 @@ public function testIPAddressValidation() {
// $edit = array();
// $edit['ip'] = \Drupal::request()->getClientIP();
// $this->drupalPostForm('admin/config/people/ban', $edit, t('Save'));
// $this->assertText(t('You may not ban your own IP address.'));
// $this->assertText('You may not ban your own IP address.');
// Test duplicate ip address are not present in the 'blocked_ips' table.
// when they are entered programmatically.
......
......@@ -49,7 +49,7 @@ public function testCachePerPage() {
// form.
$this->drupalPostForm(NULL, $form_values, t('Submit'));
$this->assertSession()->addressEquals('test-page');
$this->assertText(t('Your email address is @email', ['@email' => 'test@example.com']));
$this->assertText('Your email address is test@example.com');
// Go to a different page and see if the block is enabled there as well.
$this->drupalGet('test-render-title');
......@@ -61,7 +61,7 @@ public function testCachePerPage() {
// /test-render-title.
$this->drupalPostForm(NULL, $form_values, t('Submit'));
$this->assertSession()->addressEquals('test-render-title');
$this->assertText(t('Your email address is @email', ['@email' => 'test@example.com']));
$this->assertText('Your email address is test@example.com');
}
/**
......
......@@ -68,7 +68,7 @@ public function testBlockLinks() {
$edit['label'] = $this->randomMachineName();
$edit['id'] = mb_strtolower($edit['label']);
$this->drupalPostForm('admin/structure/menu/add', $edit, t('Save'));
$this->assertText(t('Menu @label has been added.', ['@label' => $edit['label']]));
$this->assertText('Menu ' . $edit['label'] . ' has been added.');
// Check that the block is listed for all languages.
foreach ($this->langcodes as $langcode) {
......
......@@ -200,7 +200,7 @@ public function testBlock() {
// Set block title to confirm that interface works and override any custom titles.
$this->drupalPostForm('admin/structure/block/add/' . $block['id'] . '/' . $block['theme'], ['settings[label]' => $block['settings[label]'], 'settings[label_display]' => $block['settings[label_display]'], 'id' => $block['id'], 'region' => $block['region']], t('Save block'));
$this->assertText(t('The block configuration has been saved.'), 'Block title set.');
$this->assertText('The block configuration has been saved.', 'Block title set.');
// Check to see if the block was created by checking its configuration.
$instance = Block::load($block['id']);
......@@ -216,7 +216,7 @@ public function testBlock() {
$this->clickLink('Disable');
// Confirm that the block is now listed as disabled.
$this->assertText(t('The block settings have been updated.'), 'Block successfully moved to disabled region.');
$this->assertText('The block settings have been updated.', 'Block successfully moved to disabled region.');
// Confirm that the block instance title and markup are not displayed.
$this->drupalGet('node');
......@@ -260,7 +260,7 @@ public function testBlockThemeSelector() {
$block['theme'] = $theme;
$block['region'] = 'content';
$this->drupalPostForm('admin/structure/block/add/system_powered_by_block', $block, t('Save block'));
$this->assertText(t('The block configuration has been saved.'));
$this->assertText('The block configuration has been saved.');
$this->assertSession()->addressEquals('admin/structure/block/list/' . $theme . '?block-placement=' . Html::getClass($block['id']));
// Set the default theme and ensure the block is placed.
......@@ -341,11 +341,11 @@ public function moveBlockToRegion(array $block, $region) {
$this->drupalPostForm('admin/structure/block', $edit, t('Save blocks'));
// Confirm that the block was moved to the proper region.
$this->assertText(t('The block settings have been updated.'), new FormattableMarkup('Block successfully moved to %region_name region.', ['%region_name' => $region]));
$this->assertText('The block settings have been updated.', new FormattableMarkup('Block successfully moved to %region_name region.', ['%region_name' => $region]));
// Confirm that the block is being displayed.
$this->drupalGet('');
$this->assertText(t($block['settings[label]']), 'Block successfully being displayed on the page.');
$this->assertText($block['settings[label]'], 'Block successfully being displayed on the page.');
// Confirm that the custom block was found at the proper region.
$xpath = $this->assertSession()->buildXPathQuery('//div[@class=:region-class]//div[@id=:block-id]/*', [
......
......@@ -252,7 +252,7 @@ public function testBlockDelete() {
// Delete the block.
$this->drupalGet('block/1/delete');
$this->assertText(\Drupal::translation()->formatPlural(1, 'This will also remove 1 placed block instance.', 'This will also remove @count placed block instance.'));
$this->assertText('This will also remove 1 placed block instance.');
$this->drupalPostForm(NULL, [], 'Delete');
$this->assertRaw(t('The custom block %name has been deleted.', ['%name' => $edit['info[0][value]']]));
......
......@@ -113,7 +113,7 @@ public function testListing() {
$this->assertSession()->elementTextNotContains('xpath', '//td', $new_label);
// Confirm that the empty text is displayed.
$this->assertText(t('There are no custom blocks yet.'));
$this->assertText('There are no custom blocks yet.');
$block_content = BlockContent::create([
'info' => 'Non-reusable block',
......
......@@ -174,7 +174,7 @@ public function testBlockContentTypeDeletion() {
$this->assertRaw(
t('Are you sure you want to delete the custom block type %type?', ['%type' => $type->id()])
);
$this->assertText(t('This action cannot be undone.'), 'The custom block type deletion confirmation form is available.');
$this->assertText('This action cannot be undone.', 'The custom block type deletion confirmation form is available.');
}
/**
......
......@@ -2,7 +2,6 @@
namespace Drupal\Tests\block_content\Functional;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\block_content\Entity\BlockContent;
/**
......@@ -70,7 +69,7 @@ public function testPageEdit() {
// Test deleting the block.
$this->drupalGet("block/" . $revised_block->id());
$this->clickLink(t('Delete'));
$this->assertText(new FormattableMarkup('Are you sure you want to delete the custom block @label?', ['@label' => $revised_block->label()]));
$this->assertText('Are you sure you want to delete the custom block ' . $revised_block->label() . '?');
}
}
......@@ -162,7 +162,7 @@ public function testEmptyBook() {
// Log in as a user with access to the book outline and save the form.
$this->drupalLogin($this->adminUser);
$this->drupalPostForm('admin/structure/book/' . $book->id(), [], t('Save book pages'));
$this->assertText(t('Updated book @book.', ['@book' => $book->label()]));
$this->assertText('Updated book ' . $book->label() . '.');
}
/**
......@@ -298,7 +298,7 @@ public function testBookNavigationBlock() {
$edit = [];
$edit[RoleInterface::ANONYMOUS_ID . '[node test view]'] = TRUE;
$this->drupalPostForm('admin/people/permissions/' . RoleInterface::ANONYMOUS_ID, $edit, t('Save permissions'));
$this->assertText(t('The changes have been saved.'), "Permission 'node test view' successfully assigned to anonymous users.");
$this->assertText('The changes have been saved.', "Permission 'node test view' successfully assigned to anonymous users.");
// Test correct display of the block.
$nodes = $this->createBook();
......@@ -396,7 +396,7 @@ public function testNavigationBlockOnAccessModuleInstalled() {
$edit = [];
$edit[RoleInterface::ANONYMOUS_ID . '[node test view]'] = TRUE;
$this->drupalPostForm('admin/people/permissions/' . RoleInterface::ANONYMOUS_ID, $edit, t('Save permissions'));
$this->assertText(t('The changes have been saved.'), "Permission 'node test view' successfully assigned to anonymous users.");
$this->assertText('The changes have been saved.', "Permission 'node test view' successfully assigned to anonymous users.");
// Create a book.
$this->createBook();
......
......@@ -42,7 +42,7 @@ public function testApprovalAdminInterface() {
// Test that the comments page loads correctly when there are no comments
$this->drupalGet('admin/content/comment');
$this->assertText(t('No comments available.'));
$this->assertText('No comments available.');
$this->drupalLogout();
......@@ -51,7 +51,7 @@ public function testApprovalAdminInterface() {
$body = $this->randomMachineName();
// Set $contact to true so that it won't check for id and message.
$this->postComment($this->node, $body, $subject, TRUE);
$this->assertText(t('Your comment has been queued for review by site administrators and will be published after approval.'), 'Comment requires approval.');
$this->assertText('Your comment has been queued for review by site administrators and will be published after approval.', 'Comment requires approval.');
// Get unapproved comment id.
$this->drupalLogin($this->adminUser);
......@@ -83,13 +83,13 @@ public function testApprovalAdminInterface() {
// Publish multiple comments in one operation.
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/content/comment/approval');
$this->assertText(t('Unapproved comments (@count)', ['@count' => 2]), 'Two unapproved comments waiting for approval.');
$this->assertText('Unapproved comments (2)', 'Two unapproved comments waiting for approval.');
$edit = [
"comments[{$comments[0]->id()}]" => 1,
"comments[{$comments[1]->id()}]" => 1,
];
$this->drupalPostForm(NULL, $edit, t('Update'));
$this->assertText(t('Unapproved comments (@count)', ['@count' => 0]), 'All comments were approved.');
$this->assertText('Unapproved comments (0)', 'All comments were approved.');
// Delete multiple comments in one operation.
$edit = [
......@@ -99,15 +99,15 @@ public function testApprovalAdminInterface() {
"comments[{$anonymous_comment4->id()}]" => 1,
];
$this->drupalPostForm(NULL, $edit, t('Update'));
$this->assertText(t('Are you sure you want to delete these comments and all their children?'), 'Confirmation required.');
$this->assertText('Are you sure you want to delete these comments and all their children?', 'Confirmation required.');
$this->drupalPostForm(NULL, [], t('Delete'));
$this->assertText(t('No comments available.'), 'All comments were deleted.');
$this->assertText('No comments available.', 'All comments were deleted.');
// Test message when no comments selected.
$edit = [
'operation' => 'delete',
];
$this->drupalPostForm(NULL, $edit, t('Update'));
$this->assertText(t('Select one or more comments to perform the update on.'));
$this->assertText('Select one or more comments to perform the update on.');
// Make sure the label of unpublished node is not visible on listing page.
$this->drupalGet('admin/content/comment');
......@@ -139,7 +139,7 @@ public function testApprovalNodeInterface() {
$body = $this->randomMachineName();
// Set $contact to true so that it won't check for id and message.
$this->postComment($this->node, $body, $subject, TRUE);
$this->assertText(t('Your comment has been queued for review by site administrators and will be published after approval.'), 'Comment requires approval.');
$this->assertText('Your comment has been queued for review by site administrators and will be published after approval.', 'Comment requires approval.');
// Get unapproved comment id.
$this->drupalLogin($this->adminUser);
......
......@@ -125,7 +125,7 @@ public function testAnonymous() {
$anonymous_comment3 = $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName(), TRUE);
// Name should have 'Anonymous' for value by default.
$this->assertText(t('Email field is required.'), 'Email required.');
$this->assertText('Email field is required.', 'Email required.');
$this->assertFalse($this->commentExists($anonymous_comment3), 'Anonymous comment with contact info (required) not found.');
// Post comment with contact info (required).
......
......@@ -68,7 +68,7 @@ public function testRecentCommentBlock() {
// block.
$this->drupalLogin($this->webUser);
$this->drupalGet('');
$this->assertText(t('Recent comments'));
$this->assertText('Recent comments');
// Test the only the 10 latest comments are shown and in the proper order.
$this->assertNoText($comments[10]->getSubject(), 'Comment 11 not found in block.');
......
......@@ -71,13 +71,13 @@ public function testBookCommentPrint() {
$this->assertText($comment_subject, 'Comment subject found');
$this->assertText($comment_body, 'Comment body found');
$this->assertText(t('Add new comment'), 'Comment form found');
$this->assertText('Add new comment', 'Comment form found');
// Ensure that the comment form subject field exists.
$this->assertSession()->fieldExists('subject[0][value]');
$this->drupalGet('book/export/html/' . $book_node->id());
$this->assertText(t('Comments'), 'Comment thread found');
$this->assertText('Comments', 'Comment thread found');
$this->assertText($comment_subject, 'Comment subject found');
$this->assertText($comment_body, 'Comment body found');
......
......@@ -163,7 +163,7 @@ public function testCommentFieldCreate() {
$edit = [];
$this->drupalPostForm('admin/config/people/accounts/fields/user.user.field_user_comment/storage', $edit, t('Save field settings'));
// We should get an error message.
$this->assertText(t('An illegal choice has been detected. Please contact the site administrator.'));
$this->assertText('An illegal choice has been detected. Please contact the site administrator.');
// Create a comment type for users.
$bundle = CommentType::create([
......
......@@ -242,7 +242,7 @@ public function performCommentOperation($comment, $operation, $approval = FALSE)
$this->assertRaw(\Drupal::translation()->formatPlural(1, 'Deleted 1 comment.', 'Deleted @count comments.'));
}
else {
$this->assertText(t('The update has been performed.'), new FormattableMarkup('Operation "@operation" was performed on comment.', ['@operation' => $operation]));
$this->assertText('The update has been performed.', new FormattableMarkup('Operation "@operation" was performed on comment.', ['@operation' => $operation]));
}
}
......@@ -272,7 +272,7 @@ public function testCommentFunctionality() {
$this->drupalLogin($limited_user);
// Test that default field exists.
$this->drupalGet('entity_test/structure/entity_test/fields');
$this->assertText(t('Comments'));
$this->assertText('Comments');
$this->assertSession()->linkByHrefExists('entity_test/structure/entity_test/fields/entity_test.entity_test.comment');
// Test widget hidden option is not visible when there's no comments.
$this->drupalGet('entity_test/structure/entity_test/fields/entity_test.entity_test.comment');
......
......@@ -348,7 +348,7 @@ public function testTwoPagers() {
$this->drupalPostForm(NULL, [], 'comment_settings_edit');
// Change default pager to 2.
$this->drupalPostForm(NULL, ['fields[comment][settings_edit_form][settings][pager_id]' => 2], t('Save'));
$this->assertText(t('Pager ID: @id', ['@id' => 2]));
$this->assertText('Pager ID: 2');
// Revert the changes.
$this->drupalPostForm(NULL, [], 'comment_settings_edit');
$this->drupalPostForm(NULL, ['fields[comment][settings_edit_form][settings][pager_id]' => 0], t('Save'));
......
......@@ -170,7 +170,7 @@ public function testCommentEditPreviewSave() {
// Check that saving a comment produces a success message.
$this->drupalPostForm('comment/' . $comment->id() . '/edit', $edit, t('Save'));
$this->assertText(t('Your comment has been posted.'), 'Comment posted.');
$this->assertText('Your comment has been posted.', 'Comment posted.');
// Check that the comment fields are correct after loading the saved comment.
$this->drupalGet('comment/' . $comment->id() . '/edit');
......
......@@ -228,7 +228,7 @@ public function commentExists(CommentInterface $comment = NULL, $reply = FALSE)
*/
public function deleteComment(CommentInterface $comment) {
$this->drupalPostForm('comment/' . $comment->id() . '/delete', [], t('Delete'));
$this->assertText(t('The comment and all its replies have been deleted.'), 'Comment deleted.');
$this->assertText('The comment and all its replies have been deleted.', 'Comment deleted.');
}
/**
......@@ -368,7 +368,7 @@ public function performCommentOperation(CommentInterface $comment, $operation, $
$this->assertRaw(\Drupal::translation()->formatPlural(1, 'Deleted 1 comment.', 'Deleted @count comments.'));
}
else {
$this->assertText(t('The update has been performed.'), new FormattableMarkup('Operation "@operation" was performed on comment.', ['@operation' => $operation]));
$this->assertText('The update has been performed.', new FormattableMarkup('Operation "@operation" was performed on comment.', ['@operation' => $operation]));
}
}
......
......@@ -86,7 +86,7 @@ public function testCommentTypeCreation() {
// Edit the comment-type and ensure that we cannot change the entity-type.
$this->drupalGet('admin/structure/comment/manage/foo');
$this->assertSession()->fieldNotExists('target_entity_type_id');
$this->assertText(t('Target entity type'));
$this->assertText('Target entity type');
// Save the form and ensure the entity-type value is preserved even though
// the field isn't present.
$this->drupalPostForm(NULL, [], t('Save'));
......@@ -176,7 +176,7 @@ public function testCommentTypeDeletion() {
$this->assertRaw(
t('Are you sure you want to delete the comment type %type?', ['%type' => $type->id()])
);
$this->assertText(t('This action cannot be undone.'), 'The comment type deletion confirmation form is available.');
$this->assertText('This action cannot be undone.', 'The comment type deletion confirmation form is available.');
// Test exception thrown when re-using an existing comment type.
try {
......
......@@ -53,7 +53,7 @@ public function testApprovalAdminInterface() {
// Test that the comments page loads correctly when there are no comments.
$this->drupalGet('admin/content/comment');
$this->assertText(t('No comments available.'));
$this->assertText('No comments available.');
// Assert the expose filters on the admin page.
$this->assertSession()->fieldExists('subject');
......@@ -70,7 +70,7 @@ public function testApprovalAdminInterface() {
'name' => $author_name,
'comment_body[0][value]' => $body,
], t('Save'));
$this->assertText(t('Your comment has been queued for review by site administrators and will be published after approval.'), 'Comment requires approval.');
$this->assertText('Your comment has been queued for review by site administrators and will be published after approval.', 'Comment requires approval.');
// Get unapproved comment id.
$this->drupalLogin($this->adminUser);
......@@ -107,7 +107,7 @@ public function testApprovalAdminInterface() {
// Publish multiple comments in one operation.
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/content/comment/approval');
$this->assertText(t('Unapproved comments (@count)', ['@count' => 2]), 'Two unapproved comments waiting for approval.');
$this->assertText('Unapproved comments (2)', 'Two unapproved comments waiting for approval.');
// Assert the expose filters on the admin page.
$this->assertSession()->fieldExists('subject');
......@@ -120,11 +120,11 @@ public function testApprovalAdminInterface() {
"comment_bulk_form[0]" => $comments[1]->id(),
];
$this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
$this->assertText(t('Unapproved comments (@count)', ['@count' => 0]), 'All comments were approved.');
$this->assertText('Unapproved comments (0)', 'All comments were approved.');
// Test message when no comments selected.
$this->drupalPostForm('admin/content/comment', [], t('Apply to selected items'));
$this->assertText(t('Select one or more comments to perform the update on.'));
$this->assertText('Select one or more comments to perform the update on.');
$subject_link = $this->xpath('//table/tbody/tr/td/a[contains(@href, :href) and contains(@title, :title) and text()=:text]', [
':href' => $comments[0]->permalink()->toString(),
......@@ -150,9 +150,9 @@ public function testApprovalAdminInterface() {
"comment_bulk_form[2]" => $anonymous_comment4->id(),
];
$this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
$this->assertText(t('Are you sure you want to delete these comments and all their children?'), 'Confirmation required.');
$this->assertText('Are you sure you want to delete these comments and all their children?', 'Confirmation required.');
$this->drupalPostForm(NULL, [], t('Delete'));
$this->assertText(t('No comments available.'), 'All comments were deleted.');
$this->assertText('No comments available.', 'All comments were deleted.');
// Make sure the label of unpublished node is not visible on listing page.
$this->drupalGet('admin/content/comment');
......
......@@ -70,7 +70,7 @@ public function testConfigDependencyDeleteFormTrait() {
$this->assertNoText('Configuration deletions', 'No configuration deletes found.');
$this->drupalGet($entity1->toUrl('delete-form'));
$this->assertNoText('Configuration updates', 'No configuration updates found.');
$this