From 1df5e7aa89e58ab86a9158ea320b9a8436df7791 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Wed, 10 Oct 2012 11:48:20 +0200 Subject: [PATCH] Fix test SpecialSearchTest.testSearchTermIsNotExpanded Ief0bdd10 / 9299bab "Stop expanding search term in of the search results page" had an issue comparing the site title that could be in different language. I have converted the assertion to make sur we always have the plain search term (aka: {{SITENAME}}) which will work regardless of the language currently set. Change-Id: Idbb778174978c17a75fa7671d4967851c2732c15 --- tests/phpunit/includes/specials/SpecialSearchTest.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/includes/specials/SpecialSearchTest.php b/tests/phpunit/includes/specials/SpecialSearchTest.php index fed97ad6a0..9d7dc716a9 100644 --- a/tests/phpunit/includes/specials/SpecialSearchTest.php +++ b/tests/phpunit/includes/specials/SpecialSearchTest.php @@ -129,16 +129,13 @@ class SpecialSearchTest extends MediaWikiTestCase { ->getOutput() ->getHTMLTitle(); - # Craft the expected, plain, text: - $aPlainSearchTerm = - wfMessage( 'searchresults-title', $term ) - ->plain(); - # Compare :-] - $this->assertStringStartsWith( $aPlainSearchTerm, + $this->assertRegExp( + '/' . preg_quote( $term ) . '/', $pageTitle, - "Search term should not be expanded in Special:Search <title>" + "Search term '{$term}' should not be expanded in Special:Search <title>" ); + } } -- 2.20.1