2 class BitmapMetadataHandlerTest
extends MediaWikiTestCase
{
4 public function setUp() {
5 $this->filePath
= dirname( __FILE__
) . '/../../data/media/';
9 * Test if having conflicting metadata values from different
10 * types of metadata, that the right one takes precedence.
12 * Basically the file has IPTC and XMP metadata, the
13 * IPTC should override the XMP, except for the multilingual
14 * translation (to en) where XMP should win.
16 public function testMultilingualCascade() {
17 if ( !wfDl( 'exif' ) ) {
18 $this->markTestIncomplete( "This test needs the exif extension." );
21 $meta = BitmapMetadataHandler
::Jpeg( $this->filePath
.
22 '/Xmp-exif-multilingual_test.jpg' );
25 'x-default' => 'right(iptc)',
26 'en' => 'right translation',
30 $this->assertArrayHasKey( 'ImageDescription', $meta,
31 'Did not extract any ImageDescription info?!' );
33 $this->assertEquals( $expected, $meta['ImageDescription'] );