Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
FauxSearchResult
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
 initFromTitle
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Search;
4
5use MediaWiki\FileRepo\File\File;
6use MediaWiki\Revision\RevisionRecord;
7use MediaWiki\Title\Title;
8
9/**
10 * A manually constructed search result, for use with FauxSearchResultSet.
11 */
12class FauxSearchResult extends RevisionSearchResult {
13
14    public function __construct(
15        Title $title,
16        ?RevisionRecord $revRecord = null,
17        ?File $image = null,
18        ?string $text = ''
19    ) {
20        parent::__construct( $title );
21        $this->mRevisionRecord = $revRecord;
22        $this->mImage = $image;
23        $this->mText = $text;
24    }
25
26    /**
27     * @inheritDoc
28     */
29    protected function initFromTitle( $title ) {
30        // everything's initialized in the constructor
31    }
32}
33
34/** @deprecated class alias since 1.46 */
35class_alias( FauxSearchResult::class, 'FauxSearchResult' );