3 class MockSearchResultSet
extends SearchResultSet
{
5 * @var SearchResultSet[][] Map from result type to list of results for
8 private $interwikiResults;
11 * @param SearchResult[] $results
12 * @param SearchResultSet[][] $interwikiResults Map from result type
13 * to list of results for that type.
15 public function __construct( array $results, array $interwikiResults = [] ) {
16 $this->results
= $results;
17 $this->interwikiResults
= $interwikiResults;
20 public function numRows() {
21 return count( $this->results
);
24 public function hasInterwikiResults( $type = self
::SECONDARY_RESULTS
) {
25 return isset( $this->interwikiResults
[$type] ) &&
26 count( $this->interwikiResults
[$type] ) > 0;
29 public function getInterwikiResults( $type = self
::SECONDARY_RESULTS
) {
30 if ( $this->hasInterwikiResults( $type ) ) {
31 return $this->interwikiResults
[$type];