diff --git a/core/modules/search/src/Tests/SearchKeywordsConditionsTest.php b/core/modules/search/src/Tests/SearchKeywordsConditionsTest.php index 656e001..7789f7a 100644 --- a/core/modules/search/src/Tests/SearchKeywordsConditionsTest.php +++ b/core/modules/search/src/Tests/SearchKeywordsConditionsTest.php @@ -7,6 +7,8 @@ namespace Drupal\search\Tests; +use Drupal\Component\Utility\SafeMarkup; + /** * Verify the search without keywords set and extra conditions. * @@ -59,6 +61,6 @@ function testSearchKeywordsConditions() { $keys = 'moving drop ' . $this->randomMachineName(); $this->drupalGet("search/dummy_path", array('query' => array('keys' => 'bike', 'search_conditions' => $keys))); $this->assertText("Dummy search snippet to display."); - $this->assertRaw(print_r(array('keys' => 'bike', 'search_conditions' => $keys), TRUE)); + $this->assertRaw(SafeMarkup::checkPlain(print_r(array('keys' => 'bike', 'search_conditions' => $keys), TRUE))); } } diff --git a/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php b/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php index 5c97934..75541fd 100644 --- a/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php +++ b/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php @@ -64,7 +64,7 @@ public function execute() { 'link' => Url::fromRoute('test_page_test.test_page')->toString(), 'type' => 'Dummy result type', 'title' => 'Dummy title', - 'snippet' => SafeMarkup::set("Dummy search snippet to display. Keywords: {$this->keywords}\n\nConditions: " . print_r($this->searchParameters, TRUE)), + 'snippet' => SafeMarkup::format("Dummy search snippet to display. Keywords: @keywords\n\nConditions: @search_parameters", ['@keywords' => $this->keywords, '@search_parameters' => print_r($this->searchParameters, TRUE)]), ), ); }