From: Antoine Musso Date: Wed, 10 Oct 2012 09:48:20 +0000 (+0200) Subject: Fix test SpecialSearchTest.testSearchTermIsNotExpanded X-Git-Tag: 1.31.0-rc.0~22075 X-Git-Url: http://git.cyclocoop.org/%27%40script%40/ecrire/?a=commitdiff_plain;h=1df5e7aa89e58ab86a9158ea320b9a8436df7791;p=lhc%2Fweb%2Fwiklou.git 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 --- 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>" ); + } }