diff options
Diffstat (limited to 'www/wiki/tests/phpunit/includes/media/FakeDimensionFile.php')
-rw-r--r-- | www/wiki/tests/phpunit/includes/media/FakeDimensionFile.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/www/wiki/tests/phpunit/includes/media/FakeDimensionFile.php b/www/wiki/tests/phpunit/includes/media/FakeDimensionFile.php new file mode 100644 index 00000000..5e3a3cba --- /dev/null +++ b/www/wiki/tests/phpunit/includes/media/FakeDimensionFile.php @@ -0,0 +1,35 @@ +<?php + +class FakeDimensionFile extends File { + public $mustRender = false; + public $mime; + public $dimensions; + + public function __construct( $dimensions, $mime = 'unknown/unknown' ) { + parent::__construct( Title::makeTitle( NS_FILE, 'Test' ), + new NullRepo( null ) ); + + $this->dimensions = $dimensions; + $this->mime = $mime; + } + + public function getWidth( $page = 1 ) { + return $this->dimensions[0]; + } + + public function getHeight( $page = 1 ) { + return $this->dimensions[1]; + } + + public function mustRender() { + return $this->mustRender; + } + + public function getPath() { + return ''; + } + + public function getMimeType() { + return $this->mime; + } +} |