X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fmedia%2FExifRotationTest.php;h=118dc851fd3856ec5cd31e0c2a017bc273cad382;hb=1f129a22cbc8546b89dd4b49b2f567c1f758a968;hp=f02e8b912c8fa005480f2396b8c7af3daac7a20f;hpb=117424d9e57256ffb1c27f17ba6eb004d3944ce1;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/media/ExifRotationTest.php b/tests/phpunit/includes/media/ExifRotationTest.php index f02e8b912c..118dc851fd 100644 --- a/tests/phpunit/includes/media/ExifRotationTest.php +++ b/tests/phpunit/includes/media/ExifRotationTest.php @@ -3,11 +3,17 @@ * Tests related to auto rotation. * * @group medium + * + * @todo covers tags */ class ExifRotationTest extends MediaWikiTestCase { protected function setUp() { parent::setUp(); + if ( !extension_loaded( 'exif' ) ) { + $this->markTestSkipped( "This test needs the exif extension." ); + } + $this->handler = new BitmapHandler(); $filePath = __DIR__ . '/../../data/media'; @@ -18,13 +24,10 @@ class ExifRotationTest extends MediaWikiTestCase { 'url' => 'http://localhost/thumbtest', 'backend' => new FSFileBackend( array( 'name' => 'localtesting', - 'lockManager' => 'nullLockManager', + 'wikiId' => wfWikiId(), 'containerPaths' => array( 'temp-thumb' => $tmpDir, 'data' => $filePath ) ) ) ) ); - if ( !wfDl( 'exif' ) ) { - $this->markTestSkipped( "This test needs the exif extension." ); - } $this->setMwGlobals( array( 'wgShowEXIF' => true, @@ -33,10 +36,9 @@ class ExifRotationTest extends MediaWikiTestCase { } /** - * * @dataProvider provideFiles */ - function testMetadata( $name, $type, $info ) { + public function testMetadata( $name, $type, $info ) { if ( !BitmapHandler::canRotate() ) { $this->markTestSkipped( "This test needs a rasterizer that can auto-rotate." ); } @@ -49,7 +51,7 @@ class ExifRotationTest extends MediaWikiTestCase { * * @dataProvider provideFiles */ - function testRotationRendering( $name, $type, $info, $thumbs ) { + public function testRotationRendering( $name, $type, $info, $thumbs ) { if ( !BitmapHandler::canRotate() ) { $this->markTestSkipped( "This test needs a rasterizer that can auto-rotate." ); } @@ -128,7 +130,7 @@ class ExifRotationTest extends MediaWikiTestCase { * Same as before, but with auto-rotation disabled. * @dataProvider provideFilesNoAutoRotate */ - function testMetadataNoAutoRotate( $name, $type, $info ) { + public function testMetadataNoAutoRotate( $name, $type, $info ) { $this->setMwGlobals( 'wgEnableAutoRotation', false ); $file = $this->dataFile( $name, $type ); @@ -140,7 +142,7 @@ class ExifRotationTest extends MediaWikiTestCase { * * @dataProvider provideFilesNoAutoRotate */ - function testRotationRenderingNoAutoRotate( $name, $type, $info, $thumbs ) { + public function testRotationRenderingNoAutoRotate( $name, $type, $info, $thumbs ) { $this->setMwGlobals( 'wgEnableAutoRotation', false ); foreach ( $thumbs as $size => $out ) { @@ -208,14 +210,13 @@ class ExifRotationTest extends MediaWikiTestCase { ); } - const TEST_WIDTH = 100; const TEST_HEIGHT = 200; /** * @dataProvider provideBitmapExtractPreRotationDimensions */ - function testBitmapExtractPreRotationDimensions( $rotation, $expected ) { + public function testBitmapExtractPreRotationDimensions( $rotation, $expected ) { $result = $this->handler->extractPreRotationDimensions( array( 'physicalWidth' => self::TEST_WIDTH, 'physicalHeight' => self::TEST_HEIGHT,