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