X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fmedia%2FBitmapMetadataHandlerTest.php;h=361005403919a8d011f90d12ee4c4741f6963e80;hb=97db167a0ae539d7bb9c9d4ca51b2aaaf78f1853;hp=f8262352c56ea5e6053c60556e7352e93af0a28f;hpb=99da289757bf70b4f117580c8361e1a335c74d30;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php b/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php index f8262352c5..3610054039 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' ); + '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 ); }