X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fmedia%2FBitmapMetadataHandlerTest.php;h=32a6b6ac0a726db26e661e223636a74e22fe7d7e;hp=f8262352c56ea5e6053c60556e7352e93af0a28f;hb=849af2b777ee3fe89ae5391a2c6ff496f75a0b3e;hpb=e1090009434d4908a37c8bc481fe07e96c5f647f diff --git a/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php b/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php index f8262352c5..32a6b6ac0a 100644 --- a/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php +++ b/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php @@ -77,21 +77,18 @@ class BitmapMetadataHandlerTest extends MediaWikiTestCase { $meta = BitmapMetadataHandler::Jpeg( $this->filePath . 'iptc-timetest.jpg' ); + // raw date is 2020:07:13 14:04:05+11:32 $this->assertEquals( '2020:07:14 01:36:05', $meta['DateTimeDigitized'] ); + // raw date is 1997:03:02 03:01:02-03:00 $this->assertEquals( '1997:03:02 00:01:02', $meta['DateTimeOriginal'] ); - } - /** - * File has an invalid time (+ one valid but really weird time) - * that shouldn't be included - * @covers BitmapMetadataHandler::Jpeg - */ - public function testIPTCDatesInvalid() { $meta = BitmapMetadataHandler::Jpeg( $this->filePath . 'iptc-timetest-invalid.jpg' ); + // raw date is 1845:03:02 03:01:02-03:00 $this->assertEquals( '1845:03:02 00:01:02', $meta['DateTimeOriginal'] ); - $this->assertFalse( isset( $meta['DateTimeDigitized'] ) ); + // raw date is 1942:07:13 25:05:02+00:00 + $this->assertSame( '1942:07:14 01:05:02', $meta['DateTimeDigitized'] ); } /** @@ -127,9 +124,8 @@ class BitmapMetadataHandlerTest extends MediaWikiTestCase { * @covers BitmapMetadataHandler::png */ public function testPNGXMP() { - if ( !extension_loaded( 'xml' ) ) { - $this->markTestSkipped( "This test needs the xml extension." ); - } + $this->checkPHPExtension( 'xml' ); + $handler = new BitmapMetadataHandler(); $result = $handler->PNG( $this->filePath . 'xmp.png' ); $expected = [ @@ -142,8 +138,6 @@ class BitmapMetadataHandlerTest extends MediaWikiTestCase { 'SerialNumber' => '123456789', '_MW_PNG_VERSION' => 1, ], - 'width' => 50, - 'height' => 50, ]; $this->assertEquals( $expected, $result ); }