From d7ab90d9d3c92f23a990a0c8c3fa215165770d66 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 14 Jul 2015 08:12:54 +0100
Subject: [PATCH] Issue #2502009 by joelpittet, Cottser, Wim Leers: Remove
 SafeMarkup::set in SearchExtraTypeSearch::execute()

---
 .../modules/search/src/Tests/SearchKeywordsConditionsTest.php | 4 +++-
 .../src/Plugin/Search/SearchExtraTypeSearch.php               | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/core/modules/search/src/Tests/SearchKeywordsConditionsTest.php b/core/modules/search/src/Tests/SearchKeywordsConditionsTest.php
index 656e0015d13b..7789f7accb7a 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 5c97934543b7..75541fd7243a 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)]),
       ),
     );
   }
-- 
GitLab