wiki.techinc.nl/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php
Brian Wolff a6623f7fac Move the image files used in the media tests from includes/media to data/media as the includes/media
was starting to get crowded with supporting image files.

This changes the following things
*Moves the media files to a different directory
*Changes the references to the files to reference there new locations

2 semi-unrelated changes
*Modify the README file that was basically giving credit for the images where due to explain what the images are for.
*set svn:mime-type to image/svg+xml for the svg files.
2011-08-17 23:28:31 +00:00

35 lines
1,008 B
PHP

<?php
class BitmapMetadataHandlerTest extends MediaWikiTestCase {
public function setUp() {
$this->filePath = dirname( __FILE__ ) . '/../../data/media/';
}
/**
* 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() {
if ( !wfDl( 'exif' ) ) {
$this->markTestIncomplete( "This test needs the exif extension." );
}
$meta = BitmapMetadataHandler::Jpeg( $this->filePath .
'/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'] );
}
}