Commit 7465e9ba authored by xjm's avatar xjm
Browse files

Issue #3143339 by mohrerao, mondrake, longwave: Clean up the arguments of...

Issue #3143339 by mohrerao, mondrake, longwave: Clean up the arguments of calls to WebAssert::titleEquals() and AssertLegacyTrait::assertTitle()

(cherry picked from commit e4e64fa0)
parent 95bc6694
...@@ -253,7 +253,7 @@ public function testBlockThemeSelector() { ...@@ -253,7 +253,7 @@ public function testBlockThemeSelector() {
$theme_settings = $this->config('system.theme'); $theme_settings = $this->config('system.theme');
foreach (['bartik', 'seven', 'stark'] as $theme) { foreach (['bartik', 'seven', 'stark'] as $theme) {
$this->drupalGet('admin/structure/block/list/' . $theme); $this->drupalGet('admin/structure/block/list/' . $theme);
$this->assertTitle(t('Block layout') . ' | Drupal'); $this->assertTitle('Block layout | Drupal');
// Select the 'Powered by Drupal' block to be placed. // Select the 'Powered by Drupal' block to be placed.
$block = []; $block = [];
$block['id'] = strtolower($this->randomMachineName()); $block['id'] = strtolower($this->randomMachineName());
......
...@@ -35,7 +35,7 @@ public function testListing() { ...@@ -35,7 +35,7 @@ public function testListing() {
$this->drupalGet('admin/structure/block/block-content'); $this->drupalGet('admin/structure/block/block-content');
// Test for the page title. // Test for the page title.
$this->assertTitle(t('Custom block library') . ' | Drupal'); $this->assertTitle('Custom block library | Drupal');
// Test for the table. // Test for the table.
$element = $this->xpath('//div[@class="layout-content"]//table'); $element = $this->xpath('//div[@class="layout-content"]//table');
...@@ -85,7 +85,7 @@ public function testListing() { ...@@ -85,7 +85,7 @@ public function testListing() {
$this->assertLinkByHref('block/' . $block->id()); $this->assertLinkByHref('block/' . $block->id());
$this->clickLink(t('Edit')); $this->clickLink(t('Edit'));
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertTitle(strip_tags(t('Edit custom block %label', ['%label' => $label]) . ' | Drupal')); $this->assertTitle("Edit custom block $label | Drupal");
$edit = ['info[0][value]' => $new_label]; $edit = ['info[0][value]' => $new_label];
$this->drupalPostForm(NULL, $edit, t('Save')); $this->drupalPostForm(NULL, $edit, t('Save'));
} }
...@@ -102,7 +102,7 @@ public function testListing() { ...@@ -102,7 +102,7 @@ public function testListing() {
$delete_text = t('Delete'); $delete_text = t('Delete');
$this->clickLink($delete_text); $this->clickLink($delete_text);
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertTitle(strip_tags(t('Are you sure you want to delete the custom block %label?', ['%label' => $new_label]) . ' | Drupal')); $this->assertTitle("Are you sure you want to delete the custom block $new_label? | Drupal");
$this->drupalPostForm(NULL, [], $delete_text); $this->drupalPostForm(NULL, [], $delete_text);
// Verify that the text of the label and machine name does not appear in // Verify that the text of the label and machine name does not appear in
......
...@@ -38,7 +38,7 @@ public function testListing() { ...@@ -38,7 +38,7 @@ public function testListing() {
$this->drupalGet('admin/structure/block/block-content'); $this->drupalGet('admin/structure/block/block-content');
// Test for the page title. // Test for the page title.
$this->assertTitle(t('Custom block library') . ' | Drupal'); $this->assertTitle('Custom block library | Drupal');
// Test for the exposed filters. // Test for the exposed filters.
$this->assertFieldByName('info'); $this->assertFieldByName('info');
...@@ -97,7 +97,7 @@ public function testListing() { ...@@ -97,7 +97,7 @@ public function testListing() {
$this->assertLinkByHref('block/' . $block->id()); $this->assertLinkByHref('block/' . $block->id());
$this->clickLink(t('Edit')); $this->clickLink(t('Edit'));
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertTitle(strip_tags(t('Edit custom block %label', ['%label' => $label]) . ' | Drupal')); $this->assertTitle("Edit custom block $label | Drupal");
$edit = ['info[0][value]' => $new_label]; $edit = ['info[0][value]' => $new_label];
$this->drupalPostForm(NULL, $edit, t('Save')); $this->drupalPostForm(NULL, $edit, t('Save'));
} }
...@@ -114,7 +114,7 @@ public function testListing() { ...@@ -114,7 +114,7 @@ public function testListing() {
$delete_text = t('Delete'); $delete_text = t('Delete');
$this->clickLink($delete_text); $this->clickLink($delete_text);
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertTitle(strip_tags(t('Are you sure you want to delete the custom block %label?', ['%label' => $new_label]) . ' | Drupal')); $this->assertTitle("Are you sure you want to delete the custom block $new_label? | Drupal");
$this->drupalPostForm(NULL, [], $delete_text); $this->drupalPostForm(NULL, [], $delete_text);
// Verify that the text of the label and machine name does not appear in // Verify that the text of the label and machine name does not appear in
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace Drupal\Tests\block_content\Functional; namespace Drupal\Tests\block_content\Functional;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\block_content\Entity\BlockContentType; use Drupal\block_content\Entity\BlockContentType;
use Drupal\Component\Utility\Html; use Drupal\Component\Utility\Html;
use Drupal\Core\Url; use Drupal\Core\Url;
...@@ -121,7 +120,7 @@ public function testBlockContentTypeEditing() { ...@@ -121,7 +120,7 @@ public function testBlockContentTypeEditing() {
'label' => 'Bar', 'label' => 'Bar',
]; ];
$this->drupalGet('admin/structure/block/block-content/manage/basic'); $this->drupalGet('admin/structure/block/block-content/manage/basic');
$this->assertTitle(new FormattableMarkup('Edit @type custom block type | Drupal', ['@type' => 'basic'])); $this->assertTitle('Edit basic custom block type | Drupal');
$this->drupalPostForm(NULL, $edit, t('Save')); $this->drupalPostForm(NULL, $edit, t('Save'));
$front_page_path = Url::fromRoute('<front>')->toString(); $front_page_path = Url::fromRoute('<front>')->toString();
$this->assertBreadcrumb('admin/structure/block/block-content/manage/basic/fields', [ $this->assertBreadcrumb('admin/structure/block/block-content/manage/basic/fields', [
......
...@@ -97,9 +97,7 @@ public function testCommentInterface() { ...@@ -97,9 +97,7 @@ public function testCommentInterface() {
$this->setCommentPreview(DRUPAL_OPTIONAL); $this->setCommentPreview(DRUPAL_OPTIONAL);
$this->drupalGet('comment/' . $comment->id() . '/edit'); $this->drupalGet('comment/' . $comment->id() . '/edit');
$this->assertTitle(t('Edit comment @title | Drupal', [ $this->assertTitle('Edit comment ' . $comment->getSubject() . ' | Drupal');
'@title' => $comment->getSubject(),
]));
// Test changing the comment author to "Anonymous". // Test changing the comment author to "Anonymous".
$comment = $this->postComment(NULL, $comment->comment_body->value, $comment->getSubject(), ['uid' => '']); $comment = $this->postComment(NULL, $comment->comment_body->value, $comment->getSubject(), ['uid' => '']);
......
...@@ -67,7 +67,7 @@ public function testCommentPreview() { ...@@ -67,7 +67,7 @@ public function testCommentPreview() {
$this->drupalPostForm('node/' . $this->node->id(), $edit, t('Preview')); $this->drupalPostForm('node/' . $this->node->id(), $edit, t('Preview'));
// Check that the preview is displaying the title and body. // Check that the preview is displaying the title and body.
$this->assertTitle(t('Preview comment | Drupal'), 'Page title is "Preview comment".'); $this->assertTitle('Preview comment | Drupal');
$this->assertText($edit['subject[0][value]'], 'Subject displayed.'); $this->assertText($edit['subject[0][value]'], 'Subject displayed.');
$this->assertText($edit['comment_body[0][value]'], 'Comment displayed.'); $this->assertText($edit['comment_body[0][value]'], 'Comment displayed.');
...@@ -101,7 +101,7 @@ public function testCommentPreviewDuplicateSubmission() { ...@@ -101,7 +101,7 @@ public function testCommentPreviewDuplicateSubmission() {
$this->drupalPostForm('node/' . $this->node->id(), $edit, t('Preview')); $this->drupalPostForm('node/' . $this->node->id(), $edit, t('Preview'));
// Check that the preview is displaying the title and body. // Check that the preview is displaying the title and body.
$this->assertTitle(t('Preview comment | Drupal'), 'Page title is "Preview comment".'); $this->assertTitle('Preview comment | Drupal');
$this->assertText($edit['subject[0][value]'], 'Subject displayed.'); $this->assertText($edit['subject[0][value]'], 'Subject displayed.');
$this->assertText($edit['comment_body[0][value]'], 'Comment displayed.'); $this->assertText($edit['comment_body[0][value]'], 'Comment displayed.');
...@@ -150,7 +150,7 @@ public function testCommentEditPreviewSave() { ...@@ -150,7 +150,7 @@ public function testCommentEditPreviewSave() {
$this->drupalPostForm('comment/' . $comment->id() . '/edit', $edit, t('Preview')); $this->drupalPostForm('comment/' . $comment->id() . '/edit', $edit, t('Preview'));
// Check that the preview is displaying the subject, comment, author and date correctly. // Check that the preview is displaying the subject, comment, author and date correctly.
$this->assertTitle(t('Preview comment | Drupal'), 'Page title is "Preview comment".'); $this->assertTitle('Preview comment | Drupal');
$this->assertText($edit['subject[0][value]'], 'Subject displayed.'); $this->assertText($edit['subject[0][value]'], 'Subject displayed.');
$this->assertText($edit['comment_body[0][value]'], 'Comment displayed.'); $this->assertText($edit['comment_body[0][value]'], 'Comment displayed.');
$this->assertText($web_user->getAccountName(), 'Author displayed.'); $this->assertText($web_user->getAccountName(), 'Author displayed.');
......
...@@ -41,7 +41,7 @@ public function testDraggableList() { ...@@ -41,7 +41,7 @@ public function testDraggableList() {
$this->drupalGet('admin/people/roles'); $this->drupalGet('admin/people/roles');
// Test for the page title. // Test for the page title.
$this->assertSession()->titleEquals(t('Roles') . ' | Drupal'); $this->assertSession()->titleEquals('Roles | Drupal');
// Count the number of rows in table. // Count the number of rows in table.
$rows = $this->xpath('//form[@class="user-admin-roles-form"]/table/tbody/tr'); $rows = $this->xpath('//form[@class="user-admin-roles-form"]/table/tbody/tr');
......
...@@ -301,7 +301,7 @@ public function testImportDiff() { ...@@ -301,7 +301,7 @@ public function testImportDiff() {
// Load the diff UI and verify that the diff reflects the change. // Load the diff UI and verify that the diff reflects the change.
$this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name); $this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name);
$this->assertNoRaw('&amp;nbsp;'); $this->assertNoRaw('&amp;nbsp;');
$this->assertTitle(new FormattableMarkup('View changes of @config_name | Drupal', ['@config_name' => $config_name])); $this->assertTitle("View changes of $config_name | Drupal");
// The following assertions do not use $this::assertEscaped() because // The following assertions do not use $this::assertEscaped() because
// \Drupal\Component\Diff\DiffFormatter adds markup that signifies what has // \Drupal\Component\Diff\DiffFormatter adds markup that signifies what has
......
...@@ -35,7 +35,7 @@ class ContentTranslationViewsUITest extends UITestBase { ...@@ -35,7 +35,7 @@ class ContentTranslationViewsUITest extends UITestBase {
*/ */
public function testViewsUI() { public function testViewsUI() {
$this->drupalGet('admin/structure/views/view/test_view/edit'); $this->drupalGet('admin/structure/views/view/test_view/edit');
$this->assertTitle(t('@label (@table) | @site-name', ['@label' => 'Test view', '@table' => 'Views test data', '@site-name' => $this->config('system.site')->get('name')])); $this->assertTitle('Test view (Views test data) | Drupal');
} }
} }
...@@ -95,7 +95,7 @@ public function testFileListingPages() { ...@@ -95,7 +95,7 @@ public function testFileListingPages() {
$this->drupalGet('admin/content/files/usage/' . $file->id()); $this->drupalGet('admin/content/files/usage/' . $file->id());
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertTitle(t('File usage information for @file | Drupal', ['@file' => $file->getFilename()])); $this->assertTitle('File usage information for ' . $file->getFilename() . ' | Drupal');
foreach ($nodes as &$node) { foreach ($nodes as &$node) {
$this->drupalGet('node/' . $node->id() . '/edit'); $this->drupalGet('node/' . $node->id() . '/edit');
......
...@@ -246,12 +246,12 @@ public function testForum() { ...@@ -246,12 +246,12 @@ public function testForum() {
// Test the root forum page title change. // Test the root forum page title change.
$this->drupalGet('forum'); $this->drupalGet('forum');
$this->assertCacheTag('config:taxonomy.vocabulary.' . $this->forum['vid']); $this->assertCacheTag('config:taxonomy.vocabulary.' . $this->forum['vid']);
$this->assertTitle(t('Forums | Drupal')); $this->assertTitle('Forums | Drupal');
$vocabulary = Vocabulary::load($this->forum['vid']); $vocabulary = Vocabulary::load($this->forum['vid']);
$vocabulary->set('name', 'Discussions'); $vocabulary->set('name', 'Discussions');
$vocabulary->save(); $vocabulary->save();
$this->drupalGet('forum'); $this->drupalGet('forum');
$this->assertTitle(t('Discussions | Drupal')); $this->assertTitle('Discussions | Drupal');
// Test anonymous action link. // Test anonymous action link.
$this->drupalLogout(); $this->drupalLogout();
...@@ -620,7 +620,7 @@ private function verifyForums(EntityInterface $node, $admin, $response = 200) { ...@@ -620,7 +620,7 @@ private function verifyForums(EntityInterface $node, $admin, $response = 200) {
$this->drupalGet('admin/help/forum'); $this->drupalGet('admin/help/forum');
$this->assertSession()->statusCodeEquals($response2); $this->assertSession()->statusCodeEquals($response2);
if ($response2 == 200) { if ($response2 == 200) {
$this->assertTitle(t('Forum | Drupal'), 'Forum help title was displayed'); $this->assertTitle('Forum | Drupal');
$this->assertText(t('Forum'), 'Forum help node was displayed'); $this->assertText(t('Forum'), 'Forum help node was displayed');
} }
...@@ -634,7 +634,7 @@ private function verifyForums(EntityInterface $node, $admin, $response = 200) { ...@@ -634,7 +634,7 @@ private function verifyForums(EntityInterface $node, $admin, $response = 200) {
// View forum node. // View forum node.
$this->drupalGet('node/' . $node->id()); $this->drupalGet('node/' . $node->id());
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertTitle($node->label() . ' | Drupal', 'Forum node was displayed'); $this->assertTitle($node->label() . ' | Drupal');
$breadcrumb_build = [ $breadcrumb_build = [
Link::createFromRoute(t('Home'), '<front>'), Link::createFromRoute(t('Home'), '<front>'),
Link::createFromRoute(t('Forums'), 'forum.index'), Link::createFromRoute(t('Forums'), 'forum.index'),
...@@ -651,7 +651,7 @@ private function verifyForums(EntityInterface $node, $admin, $response = 200) { ...@@ -651,7 +651,7 @@ private function verifyForums(EntityInterface $node, $admin, $response = 200) {
$this->drupalGet('node/' . $node->id() . '/edit'); $this->drupalGet('node/' . $node->id() . '/edit');
$this->assertSession()->statusCodeEquals($response); $this->assertSession()->statusCodeEquals($response);
if ($response == 200) { if ($response == 200) {
$this->assertTitle('Edit Forum topic ' . $node->label() . ' | Drupal', 'Forum edit node was displayed'); $this->assertTitle('Edit Forum topic ' . $node->label() . ' | Drupal');
} }
if ($response == 200) { if ($response == 200) {
......
...@@ -127,7 +127,7 @@ protected function verifyHelp($response = 200) { ...@@ -127,7 +127,7 @@ protected function verifyHelp($response = 200) {
$this->drupalGet('admin/help/' . $module); $this->drupalGet('admin/help/' . $module);
$this->assertSession()->statusCodeEquals($response); $this->assertSession()->statusCodeEquals($response);
if ($response == 200) { if ($response == 200) {
$this->assertTitle($name . ' | Drupal', new FormattableMarkup('%module title was displayed', ['%module' => $module])); $this->assertTitle("$name | Drupal");
$this->assertEquals($name, $this->cssSelect('h1.page-title')[0]->getText(), "$module heading was displayed"); $this->assertEquals($name, $this->cssSelect('h1.page-title')[0]->getText(), "$module heading was displayed");
$info = \Drupal::service('extension.list.module')->getExtensionInfo($module); $info = \Drupal::service('extension.list.module')->getExtensionInfo($module);
$admin_tasks = system_get_module_admin_tasks($module, $info); $admin_tasks = system_get_module_admin_tasks($module, $info);
......
...@@ -216,7 +216,7 @@ public function testStyle() { ...@@ -216,7 +216,7 @@ public function testStyle() {
// Check that the URL was updated. // Check that the URL was updated.
$this->drupalGet($style_path); $this->drupalGet($style_path);
$this->assertTitle(t('Edit style @name | Drupal', ['@name' => $style_label])); $this->assertTitle("Edit style $style_label | Drupal");
// Check that the available image effects are properly sorted. // Check that the available image effects are properly sorted.
$option = $this->xpath('//select[@id=:id]//option', [':id' => 'edit-new--2']); $option = $this->xpath('//select[@id=:id]//option', [':id' => 'edit-new--2']);
......
...@@ -93,7 +93,7 @@ public function testLanguageList() { ...@@ -93,7 +93,7 @@ public function testLanguageList() {
// Ensure 'Edit' link works. // Ensure 'Edit' link works.
$this->drupalGet('admin/config/regional/language'); $this->drupalGet('admin/config/regional/language');
$this->clickLink(t('Edit')); $this->clickLink(t('Edit'));
$this->assertTitle(t('Edit language | Drupal'), 'Page title is "Edit language".'); $this->assertTitle('Edit language | Drupal');
// Edit a language. // Edit a language.
$name = $this->randomMachineName(16); $name = $this->randomMachineName(16);
$edit = [ $edit = [
......
...@@ -709,7 +709,7 @@ public function verifyMenuLink(MenuLinkContent $item, $item_node, MenuLinkConten ...@@ -709,7 +709,7 @@ public function verifyMenuLink(MenuLinkContent $item, $item_node, MenuLinkConten
// Verify menu link link. // Verify menu link link.
$this->clickLink($title); $this->clickLink($title);
$title = $parent_node->label(); $title = $parent_node->label();
$this->assertTitle(t("@title | Drupal", ['@title' => $title]), 'Parent menu link link target was correct'); $this->assertTitle("$title | Drupal");
} }
// Verify menu link. // Verify menu link.
...@@ -719,7 +719,7 @@ public function verifyMenuLink(MenuLinkContent $item, $item_node, MenuLinkConten ...@@ -719,7 +719,7 @@ public function verifyMenuLink(MenuLinkContent $item, $item_node, MenuLinkConten
// Verify menu link link. // Verify menu link link.
$this->clickLink($title); $this->clickLink($title);
$title = $item_node->label(); $title = $item_node->label();
$this->assertTitle(t("@title | Drupal", ['@title' => $title]), 'Menu link link target was correct'); $this->assertTitle("$title | Drupal");
} }
/** /**
......
...@@ -83,7 +83,7 @@ public function testNodeTitle() { ...@@ -83,7 +83,7 @@ public function testNodeTitle() {
$node = $this->drupalCreateNode($settings); $node = $this->drupalCreateNode($settings);
// Test that 0 appears as <title>. // Test that 0 appears as <title>.
$this->drupalGet('node/' . $node->id()); $this->drupalGet('node/' . $node->id());
$this->assertTitle(0 . ' | Drupal', 'Page title is equal to 0.', 'Node'); $this->assertTitle('0 | Drupal');
// Test that 0 appears in the template <h1>. // Test that 0 appears in the template <h1>.
$xpath = '//h1'; $xpath = '//h1';
$this->assertSame('0', $this->xpath($xpath)[0]->getText(), 'Node title is displayed as 0.'); $this->assertSame('0', $this->xpath($xpath)[0]->getText(), 'Node title is displayed as 0.');
......
...@@ -440,7 +440,7 @@ public function testPagePreviewWithRevisions() { ...@@ -440,7 +440,7 @@ public function testPagePreviewWithRevisions() {
$this->drupalPostForm('node/add/page', $edit, t('Preview')); $this->drupalPostForm('node/add/page', $edit, t('Preview'));
// Check that the preview is displaying the title, body and term. // Check that the preview is displaying the title, body and term.
$this->assertTitle(t('@title | Drupal', ['@title' => $edit[$title_key]]), 'Basic page title is preview.'); $this->assertTitle($edit[$title_key] . ' | Drupal');
$this->assertText($edit[$title_key], 'Title displayed.'); $this->assertText($edit[$title_key], 'Title displayed.');
$this->assertText($edit[$body_key], 'Body displayed.'); $this->assertText($edit[$body_key], 'Body displayed.');
$this->assertText($edit[$term_key], 'Term displayed.'); $this->assertText($edit[$term_key], 'Term displayed.');
......
...@@ -68,7 +68,7 @@ public function testSearchText() { ...@@ -68,7 +68,7 @@ public function testSearchText() {
$this->drupalGet('search/node'); $this->drupalGet('search/node');
$this->assertText(t('Enter your keywords')); $this->assertText(t('Enter your keywords'));
$this->assertText(t('Search')); $this->assertText(t('Search'));
$this->assertTitle(t('Search') . ' | Drupal', 'Search page title is correct'); $this->assertTitle('Search | Drupal');
$edit = []; $edit = [];
$search_terms = 'bike shed ' . $this->randomMachineName(); $search_terms = 'bike shed ' . $this->randomMachineName();
...@@ -77,7 +77,7 @@ public function testSearchText() { ...@@ -77,7 +77,7 @@ public function testSearchText() {
$this->assertText('search yielded no results'); $this->assertText('search yielded no results');
$this->assertText(t('Search')); $this->assertText(t('Search'));
$title_source = 'Search for @keywords | Drupal'; $title_source = 'Search for @keywords | Drupal';
$this->assertTitle(t($title_source, ['@keywords' => Unicode::truncate($search_terms, 60, TRUE, TRUE)]), 'Search page title is correct'); $this->assertTitle('Search for ' . Unicode::truncate($search_terms, 60, TRUE, TRUE) . ' | Drupal');
$this->assertNoText('Node', 'Erroneous tab and breadcrumb text is not present'); $this->assertNoText('Node', 'Erroneous tab and breadcrumb text is not present');
$this->assertNoText(t('Node'), 'Erroneous translated tab and breadcrumb text is not present'); $this->assertNoText(t('Node'), 'Erroneous translated tab and breadcrumb text is not present');
$this->assertText(t('Content'), 'Tab and breadcrumb text is present'); $this->assertText(t('Content'), 'Tab and breadcrumb text is present');
...@@ -91,7 +91,7 @@ public function testSearchText() { ...@@ -91,7 +91,7 @@ public function testSearchText() {
$search_terms = 'Every word is like an unnecessary stain on silence and nothingness.'; $search_terms = 'Every word is like an unnecessary stain on silence and nothingness.';
$edit['keys'] = $search_terms; $edit['keys'] = $search_terms;
$this->drupalPostForm('search/node', $edit, t('Search')); $this->drupalPostForm('search/node', $edit, t('Search'));
$this->assertTitle(t($title_source, ['@keywords' => 'Every word is like an unnecessary stain on silence and…']), 'Search page title is correct'); $this->assertTitle('Search for Every word is like an unnecessary stain on silence and… | Drupal');
// Search for a string with a lot of special characters. // Search for a string with a lot of special characters.
$search_terms = 'Hear nothing > "see nothing" `feel' . " '1982."; $search_terms = 'Hear nothing > "see nothing" `feel' . " '1982.";
...@@ -103,7 +103,7 @@ public function testSearchText() { ...@@ -103,7 +103,7 @@ public function testSearchText() {
$edit['keys'] = $this->searchingUser->getAccountName(); $edit['keys'] = $this->searchingUser->getAccountName();
$this->drupalPostForm('search/user', $edit, t('Search')); $this->drupalPostForm('search/user', $edit, t('Search'));
$this->assertText(t('Search')); $this->assertText(t('Search'));
$this->assertTitle(t($title_source, ['@keywords' => Unicode::truncate($this->searchingUser->getAccountName(), 60, TRUE, TRUE)])); $this->assertTitle('Search for ' . Unicode::truncate($this->searchingUser->getAccountName(), 60, TRUE, TRUE) . ' | Drupal');
$this->clickLink('Search help'); $this->clickLink('Search help');
$this->assertText('Search help', 'Correct title is on search help page'); $this->assertText('Search help', 'Correct title is on search help page');
......
...@@ -60,7 +60,7 @@ public function testShortcutSetEdit() { ...@@ -60,7 +60,7 @@ public function testShortcutSetEdit() {
$this->drupalGet('admin/config/user-interface/shortcut/manage/' . $set->id() . '/customize'); $this->drupalGet('admin/config/user-interface/shortcut/manage/' . $set->id() . '/customize');
// Test for the page title. // Test for the page title.
$this->assertTitle(t('List links') . ' | Drupal'); $this->assertTitle('List links | Drupal');
// Test for the table. // Test for the table.
$element = $this->xpath('//div[@class="layout-content"]//table'); $element = $this->xpath('//div[@class="layout-content"]//table');
......
...@@ -29,7 +29,7 @@ public function testConfirmForm() { ...@@ -29,7 +29,7 @@ public function testConfirmForm() {
// Test the building of the form. // Test the building of the form.
$this->drupalGet('form-test/confirm-form'); $this->drupalGet('form-test/confirm-form');
$site_name = $this->config('system.site')->get('name'); $site_name = $this->config('system.site')->get('name');
$this->assertTitle(t('ConfirmFormTestForm::getQuestion(). | @site-name', ['@site-name' => $site_name]), 'The question was found as the page title.'); $this->assertTitle("ConfirmFormTestForm::getQuestion(). | $site_name");
$this->assertText(t('ConfirmFormTestForm::getDescription().'), 'The description was used.'); $this->assertText(t('ConfirmFormTestForm::getDescription().'), 'The description was used.');
$this->assertFieldByXPath('//input[@id="edit-submit"]', t('ConfirmFormTestForm::getConfirmText().'), 'The confirm text was used.'); $this->assertFieldByXPath('//input[@id="edit-submit"]', t('ConfirmFormTestForm::getConfirmText().'), 'The confirm text was used.');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment