4 class JpegTest
extends MediaWikiTestCase
{
6 public function testInvalidFile() {
7 if ( !wfDl( 'exif' ) ) {
8 $this->markTestIncomplete( "This test needs the exif extension." );
10 $jpeg = new JpegHandler
;
11 $res = $jpeg->getMetadata( null, dirname( __FILE__
) . '/README' );
12 $this->assertEquals( ExifBitmapHandler
::BROKEN_FILE
, $res );
14 public function testTiffFile() {
15 if ( !wfDl( 'exif' ) ) {
16 $this->markTestIncomplete( "This test needs the exif extension." );
19 $res = $h->getMetadata( null, dirname( __FILE__
) . '/test.jpg' );
20 $expected = 'a:7:{s:16:"ImageDescription";s:9:"Test file";s:11:"XResolution";s:4:"72/1";s:11:"YResolution";s:4:"72/1";s:14:"ResolutionUnit";i:2;s:16:"YCbCrPositioning";i:1;s:15:"JPEGFileComment";a:1:{i:0;s:17:"Created with GIMP";}s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}';
21 // Hopefully php always serializes things in the same order.
22 $this->assertEquals( $expected, $res );