3 class SpecialSearchTestMockResultSet
extends SearchResultSet
{
6 /** @var string|null */
8 /** @var string|null */
9 protected $rewrittenQuery;
11 protected $containedSyntax;
13 public function __construct(
15 $rewrittenQuery = null,
17 $containedSyntax = false
19 $this->suggestion
= $suggestion;
20 $this->rewrittenQuery
= $rewrittenQuery;
21 $this->results
= $results;
22 $this->containedSyntax
= $containedSyntax;
25 public function expandResults() {
26 return $this->results
;
29 public function getTotalHits() {
30 return $this->numRows();
33 public function hasSuggestion() {
34 return $this->suggestion
!== null;
37 public function getSuggestionQuery() {
38 return $this->suggestion
;
41 public function getSuggestionSnippet() {
42 return $this->suggestion
;
45 public function hasRewrittenQuery() {
46 return $this->rewrittenQuery
!== null;
49 public function getQueryAfterRewrite() {
50 return $this->rewrittenQuery
;
53 public function getQueryAfterRewriteSnippet() {
54 return htmlspecialchars( $this->rewrittenQuery
);
57 public function getFirstResult() {
58 if ( count( $this->results
) === 0 ) {
61 return $this->results
[0]->getTitle();