Ief0bdd10 /
9299bab "Stop expanding search term in <title> 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
->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>"
);
+
}
}