wiki.techinc.nl/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php
Platonides eded6a8db8 Make BitmapMetadataHandlerTest incomplete if $wgShowEXIF is not set.
It was throwing 'MWException: Internal error: exif_read_data not present. $wgShowEXIF may be incorrectly set or not checked by an extension.'
Fixed typo in LocalSettings.
2011-06-29 13:45:57 +00:00

31 lines
935 B
PHP

<?php
class BitmapMetadataHandlerTest extends MediaWikiTestCase {
/**
* Test if having conflicting metadata values from different
* types of metadata, that the right one takes precedence.
*
* Basically the file has IPTC and XMP metadata, the
* IPTC should override the XMP, except for the multilingual
* translation (to en) where XMP should win.
*/
public function testMultilingualCascade() {
global $wgShowEXIF;
if ( !$wgShowEXIF ) {
$this->markTestIncomplete( "This test needs the exif extension." );
}
$meta = BitmapMetadataHandler::Jpeg( dirname( __FILE__ ) .
'/Xmp-exif-multilingual_test.jpg' );
$expected = array(
'x-default' => 'right(iptc)',
'en' => 'right translation',
'_type' => 'lang'
);
$this->assertArrayHasKey( 'ImageDescription', $meta,
'Did not extract any ImageDescription info?!' );
$this->assertEquals( $expected, $meta['ImageDescription'] );
}
}