From 14f74d141ab5580688bfd46d2f74c026e43ed967 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 1 Apr 2015 06:11:44 +0200 Subject: Update to MediaWiki 1.24.2 --- tests/phpunit/mocks/media/MockDjVuHandler.php | 49 +++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/phpunit/mocks/media/MockDjVuHandler.php (limited to 'tests/phpunit/mocks/media/MockDjVuHandler.php') diff --git a/tests/phpunit/mocks/media/MockDjVuHandler.php b/tests/phpunit/mocks/media/MockDjVuHandler.php new file mode 100644 index 00000000..31cb13dc --- /dev/null +++ b/tests/phpunit/mocks/media/MockDjVuHandler.php @@ -0,0 +1,49 @@ +normaliseParams( $image, $params ) ) { + return new TransformParameterError( $params ); + } + $width = $params['width']; + $height = $params['height']; + $page = $params['page']; + if ( $page > $this->pageCount( $image ) ) { + return new MediaTransformError( + 'thumbnail_error', + $width, + $height, + wfMessage( 'djvu_page_error' )->text() + ); + } + + $params = array( + 'width' => $width, + 'height' => $height, + 'page' => $page + ); + + return new ThumbnailImage( $image, $dstUrl, $dstPath, $params ); + } +} -- cgit v1.2.2