diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchAdvancedSearchFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchAdvancedSearchFormTest.php index db55981..5b0efeb 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchAdvancedSearchFormTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchAdvancedSearchFormTest.php @@ -42,30 +42,30 @@ class SearchAdvancedSearchFormTest extends SearchTestBase { * Test using the advanced search form to limit search to nodes of type "Basic page". */ function testNodeType() { - $this->assertTrue($this->node->type == 'page', t('Node type is Basic page.')); + $this->assertTrue($this->node->type == 'page', 'Node type is Basic page.'); // Assert that the dummy title doesn't equal the real title. $dummy_title = 'Lorem ipsum'; - $this->assertNotEqual($dummy_title, $this->node->label(), t("Dummy title doesn't equal node title")); + $this->assertNotEqual($dummy_title, $this->node->label(), "Dummy title doesn't equal node title."); // Search for the dummy title with a GET query. $this->drupalGet('search/node/' . $dummy_title); - $this->assertNoText($this->node->label(), t('Basic page node is not found with dummy title.')); + $this->assertNoText($this->node->label(), 'Basic page node is not found with dummy title.'); // Search for the title of the node with a GET query. $this->drupalGet('search/node/' . $this->node->label()); - $this->assertText($this->node->label(), t('Basic page node is found with GET query.')); + $this->assertText($this->node->label(), 'Basic page node is found with GET query.'); // Search for the title of the node with a POST query. $edit = array('or' => $this->node->label()); $this->drupalPost('search/node', $edit, t('Advanced search')); - $this->assertText($this->node->label(), t('Basic page node is found with POST query.')); + $this->assertText($this->node->label(), 'Basic page node is found with POST query.'); // Advanced search type option. $this->drupalPost('search/node', array_merge($edit, array('type[page]' => 'page')), t('Advanced search')); - $this->assertText($this->node->label(), t('Basic page node is found with POST query and type:page.')); + $this->assertText($this->node->label(), 'Basic page node is found with POST query and type:page.'); $this->drupalPost('search/node', array_merge($edit, array('type[article]' => 'article')), t('Advanced search')); - $this->assertText('bike shed', t('Article node is not found with POST query and type:article.')); + $this->assertText('bike shed', 'Article node is not found with POST query and type:article.'); } } diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchBlockTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchBlockTest.php index 93bb9a6..0ab941e 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchBlockTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchBlockTest.php @@ -35,13 +35,13 @@ class SearchBlockTest extends SearchTestBase { function testSearchFormBlock() { // Set block title to confirm that the interface is available. $this->drupalPost('admin/structure/block/manage/search/form/configure', array('title' => $this->randomName(8)), t('Save block')); - $this->assertText(t('The block configuration has been saved.'), t('Block configuration set.')); + $this->assertText(t('The block configuration has been saved.'), 'Block configuration set.'); // Set the block to a region to confirm block is available. $edit = array(); $edit['blocks[search_form][region]'] = 'footer'; $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); - $this->assertText(t('The block settings have been updated.'), t('Block successfully move to footer region.')); + $this->assertText(t('The block settings have been updated.'), 'Block successfully move to footer region.'); } /** @@ -75,7 +75,7 @@ class SearchBlockTest extends SearchTestBase { $this->assertEqual( $this->getUrl(), url('search/node/' . $terms['search_block_form'], array('absolute' => TRUE)), - t('Redirected to correct url.') + 'Redirected to correct url.' ); // Test an empty search via the block form, from the front page. @@ -87,7 +87,7 @@ class SearchBlockTest extends SearchTestBase { $this->assertEqual( $this->getUrl(), url('search/node/', array('absolute' => TRUE)), - t('Redirected to correct url.') + 'Redirected to correct url.' ); } } diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php index cb35b06..338174d 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php @@ -85,8 +85,8 @@ class SearchCommentCountToggleTest extends SearchTestBase { // Test comment count display for nodes with comment status set to Open $this->drupalPost('', $edit, t('Search')); - $this->assertText(t('0 comments'), t('Empty comment count displays for nodes with comment status set to Open')); - $this->assertText(t('1 comment'), t('Non-empty comment count displays for nodes with comment status set to Open')); + $this->assertText(t('0 comments'), 'Empty comment count displays for nodes with comment status set to Open'); + $this->assertText(t('1 comment'), 'Non-empty comment count displays for nodes with comment status set to Open'); // Test comment count display for nodes with comment status set to Closed $this->searchable_nodes['0 comments']->comment = COMMENT_NODE_CLOSED; @@ -95,8 +95,8 @@ class SearchCommentCountToggleTest extends SearchTestBase { node_save($this->searchable_nodes['1 comment']); $this->drupalPost('', $edit, t('Search')); - $this->assertNoText(t('0 comments'), t('Empty comment count does not display for nodes with comment status set to Closed')); - $this->assertText(t('1 comment'), t('Non-empty comment count displays for nodes with comment status set to Closed')); + $this->assertNoText(t('0 comments'), 'Empty comment count does not display for nodes with comment status set to Closed'); + $this->assertText(t('1 comment'), 'Non-empty comment count displays for nodes with comment status set to Closed'); // Test comment count display for nodes with comment status set to Hidden $this->searchable_nodes['0 comments']->comment = COMMENT_NODE_HIDDEN; @@ -105,7 +105,7 @@ class SearchCommentCountToggleTest extends SearchTestBase { node_save($this->searchable_nodes['1 comment']); $this->drupalPost('', $edit, t('Search')); - $this->assertNoText(t('0 comments'), t('Empty comment count does not display for nodes with comment status set to Hidden')); - $this->assertNoText(t('1 comment'), t('Non-empty comment count does not display for nodes with comment status set to Hidden')); + $this->assertNoText(t('0 comments'), 'Empty comment count does not display for nodes with comment status set to Hidden'); + $this->assertNoText(t('1 comment'), 'Non-empty comment count does not display for nodes with comment status set to Hidden'); } } diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php index 8df2e99..d6c25b1 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php @@ -90,20 +90,20 @@ class SearchCommentTest extends SearchTestBase { ); $this->drupalPost('', $edit, t('Search')); $node2 = node_load($node->nid, TRUE); - $this->assertText($node2->label(), t('Node found in search results.')); - $this->assertText($edit_comment['subject'], t('Comment subject found in search results.')); + $this->assertText($node2->label(), 'Node found in search results.'); + $this->assertText($edit_comment['subject'], 'Comment subject found in search results.'); // Search for the comment body. $edit = array( 'search_block_form' => "'" . $comment_body . "'", ); $this->drupalPost('', $edit, t('Search')); - $this->assertText($node2->label(), t('Node found in search results.')); + $this->assertText($node2->label(), 'Node found in search results.'); // Verify that comment is rendered using proper format. - $this->assertText($comment_body, t('Comment body text found in search results.')); - $this->assertNoRaw(t('n/a'), t('HTML in comment body is not hidden.')); - $this->assertNoRaw(check_plain($edit_comment['comment_body[' . LANGUAGE_NOT_SPECIFIED . '][0][value]']), t('HTML in comment body is not escaped.')); + $this->assertText($comment_body, 'Comment body text found in search results.'); + $this->assertNoRaw(t('n/a'), 'HTML in comment body is not hidden.'); + $this->assertNoRaw(check_plain($edit_comment['comment_body[' . LANGUAGE_NOT_SPECIFIED . '][0][value]']), 'HTML in comment body is not escaped.'); // Hide comments. $this->drupalLogin($this->admin_user); @@ -116,7 +116,7 @@ class SearchCommentTest extends SearchTestBase { // Search for $title. $this->drupalPost('', $edit, t('Search')); - $this->assertNoText($comment_body, t('Comment body text not found in search results.')); + $this->assertNoText($comment_body, 'Comment body text not found in search results.'); } /** @@ -231,7 +231,7 @@ class SearchCommentTest extends SearchTestBase { // Verify that if you view the node on its own page, 'add new comment' // is there. $this->drupalGet('node/' . $node->nid); - $this->assertText(t('Add new comment'), t('Add new comment appears on node page')); + $this->assertText(t('Add new comment'), 'Add new comment appears on node page'); // Run cron to index this page. $this->drupalLogout(); @@ -240,12 +240,12 @@ class SearchCommentTest extends SearchTestBase { // Search for 'comment'. Should be no results. $this->drupalLogin($user); $this->drupalPost('search/node', array('keys' => 'comment'), t('Search')); - $this->assertText(t('Your search yielded no results'), t('No results searching for the word comment')); + $this->assertText(t('Your search yielded no results'), 'No results searching for the word comment'); // Search for the node title. Should be found, and 'Add new comment' should // not be part of the search snippet. $this->drupalPost('search/node', array('keys' => 'short'), t('Search')); - $this->assertText($node->label(), t('Search for keyword worked')); - $this->assertNoText(t('Add new comment'), t('Add new comment does not appear on search results page')); + $this->assertText($node->label(), 'Search for keyword worked'); + $this->assertNoText(t('Add new comment'), 'Add new comment does not appear on search results page'); } } diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php index 7c123a0..066da60 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php @@ -169,7 +169,7 @@ class SearchConfigSettingsFormTest extends SearchTestBase { $this->drupalGet($path); foreach ($modules as $module) { $title = $module_info[$module]['title']; - $this->assertText($title, $title . ' search tab is shown'); + $this->assertText($title, format_string('%title search tab is shown', array('%title' => $title))); } } } diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchLanguageTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchLanguageTest.php index 4047c42..cdaf04b 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchLanguageTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchLanguageTest.php @@ -39,30 +39,30 @@ class SearchLanguageTest extends SearchTestBase { // Add predefined language. $edit = array('predefined_langcode' => 'fr'); $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language')); - $this->assertText('French', t('Language added successfully.')); + $this->assertText('French', 'Language added successfully.'); // Now we should have languages displayed. $this->drupalGet('search/node'); - $this->assertText(t('Languages'), t('Languages displayed to choose from.')); - $this->assertText(t('English'), t('English is a possible choice.')); - $this->assertText(t('French'), t('French is a possible choice.')); + $this->assertText(t('Languages'), 'Languages displayed to choose from.'); + $this->assertText(t('English'), 'English is a possible choice.'); + $this->assertText(t('French'), 'French is a possible choice.'); // Ensure selecting no language does not make the query different. $this->drupalPost('search/node', array(), t('Advanced search')); - $this->assertEqual($this->getUrl(), url('search/node/', array('absolute' => TRUE)), t('Correct page redirection, no language filtering.')); + $this->assertEqual($this->getUrl(), url('search/node/', array('absolute' => TRUE)), 'Correct page redirection, no language filtering.'); // Pick French and ensure it is selected. $edit = array('language[fr]' => TRUE); $this->drupalPost('search/node', $edit, t('Advanced search')); - $this->assertFieldByXPath('//input[@name="keys"]', 'language:fr', t('Language filter added to query.')); + $this->assertFieldByXPath('//input[@name="keys"]', 'language:fr', 'Language filter added to query.'); // Change the default language and delete English. $path = 'admin/config/regional/language'; $this->drupalGet($path); - $this->assertFieldChecked('edit-site-default-en', t('English is the default language.')); + $this->assertFieldChecked('edit-site-default-en', 'English is the default language.'); $edit = array('site_default' => 'fr'); $this->drupalPost(NULL, $edit, t('Save configuration')); - $this->assertNoFieldChecked('edit-site-default-en', t('Default language updated.')); + $this->assertNoFieldChecked('edit-site-default-en', 'Default language updated.'); $this->drupalPost('admin/config/regional/language/delete/en', array(), t('Delete')); } } diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchNumberMatchingTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchNumberMatchingTest.php index 39cf650..540526b 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchNumberMatchingTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchNumberMatchingTest.php @@ -70,7 +70,7 @@ class SearchNumberMatchingTest extends SearchTestBase { $this->drupalPost('search/node', array('keys' => 'foo'), t('Search')); - $this->assertNoText($node->label(), $i . ': node title not shown in dummy search'); + $this->assertNoText($node->label(), format_string('%number: node title not shown in dummy search', array('%number' => $i))); // Now verify that we can find node i by searching for any of the // numbers. @@ -83,7 +83,7 @@ class SearchNumberMatchingTest extends SearchTestBase { $this->drupalPost('search/node', array('keys' => $number), t('Search')); - $this->assertText($node->label(), $i . ': node title shown (search found the node) in search for number ' . $number); + $this->assertText($node->label(), format_string('%i: node title shown (search found the node) in search for number %number', array('%i' => $i, '%number' => $number))); } } diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchNumbersTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchNumbersTest.php index dd119b9..f5c3d44 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchNumbersTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchNumbersTest.php @@ -90,7 +90,7 @@ class SearchNumbersTest extends SearchTestBase { $this->drupalPost('search/node', array('keys' => $number), t('Search')); - $this->assertText($node->label(), $type . ': node title shown (search found the node) in search for number ' . $number); + $this->assertText($node->label(), format_string('%type: node title shown (search found the node) in search for number %number.', ('%type' => $type, '%number' => $number))); } } } diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php index 03b9619..b9451ad 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php @@ -42,7 +42,7 @@ class SearchPageTextTest extends SearchTestBase { $edit = array(); $edit['keys'] = 'bike shed ' . $this->randomName(); $this->drupalPost('search/node', $edit, t('Search')); - $this->assertText(t('Consider loosening your query with OR. bike OR shed will often show more results than bike shed.'), t('Help text is displayed when search returns no results.')); + $this->assertText(t('Consider loosening your query with OR. bike OR shed will often show more results than bike shed.'), 'Help text is displayed when search returns no results.'); $this->assertText(t('Search')); $this->assertTitle($title, 'Search page title is correct'); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchSimplifyTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchSimplifyTest.php index f316588..5b1e5d4 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchSimplifyTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchSimplifyTest.php @@ -68,7 +68,7 @@ class SearchSimplifyTest extends SearchTestBase { for ($i = 0; $i < 32; $i++) { $string .= chr($i); } - $this->assertIdentical(' ', search_simplify($string), t('Search simplify works for ASCII control characters.')); + $this->assertIdentical(' ', search_simplify($string), 'Search simplify works for ASCII control characters.'); } /**