Merge "AutoLoader: Use require_once rather than require"
[mediawiki.git] / tests / phpunit / includes / media / FakeDimensionFile.php
blob077858df86d8c0da3f18e6929a53caa9f2f37b7e
1 <?php
3 use MediaWiki\Title\Title;
5 class FakeDimensionFile extends File {
6 /** @var bool */
7 public $mustRender = false;
8 /** @var string */
9 public $mime;
10 /** @var int[] */
11 public $dimensions;
13 public function __construct( $dimensions, $mime = 'unknown/unknown' ) {
14 parent::__construct( Title::makeTitle( NS_FILE, 'Test' ),
15 new NullRepo( null ) );
17 $this->dimensions = $dimensions;
18 $this->mime = $mime;
21 public function getWidth( $page = 1 ) {
22 return $this->dimensions[0];
25 public function getHeight( $page = 1 ) {
26 return $this->dimensions[1];
29 public function mustRender() {
30 return $this->mustRender;
33 public function getPath() {
34 return '';
37 public function getMimeType() {
38 return $this->mime;