| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
class Jpeg2000HandlerTest extends MediaWikiIntegrationTestCase { |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
public function testGetSizeAndMetadata( $path, $expectedResult ) { |
| 12 |
$handler = new Jpeg2000Handler(); |
| 13 |
$this->assertEquals( $expectedResult, $handler->getSizeAndMetadata( |
| 14 |
new TrivialMediaHandlerState, $path ) ); |
| 15 |
} |
| 16 |
|
| 17 |
public static function provideTestGetSizeAndMetadata() { |
| 18 |
return [ |
| 19 |
[ __DIR__ . '/../../data/media/jpeg2000-lossless.jp2', [ |
| 20 |
'width' => 100, |
| 21 |
'height' => 100, |
| 22 |
'bits' => 8, |
| 23 |
] ], |
| 24 |
[ __DIR__ . '/../../data/media/jpeg2000-lossy.jp2', [ |
| 25 |
'width' => 100, |
| 26 |
'height' => 100, |
| 27 |
'bits' => 8, |
| 28 |
] ], |
| 29 |
[ __DIR__ . '/../../data/media/jpeg2000-alpha.jp2', [ |
| 30 |
'width' => 100, |
| 31 |
'height' => 100, |
| 32 |
'bits' => 8, |
| 33 |
] ], |
| 34 |
[ __DIR__ . '/../../data/media/jpeg2000-profile.jpf', [ |
| 35 |
'width' => 100, |
| 36 |
'height' => 100, |
| 37 |
'bits' => 8, |
| 38 |
] ], |
| 39 |
|
| 40 |
|
| 41 |
[ __FILE__, [] ], |
| 42 |
]; |
| 43 |
} |
| 44 |
} |