X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fmedia%2FIPTCTest.php;h=4b3ba0755c792b18b7f83e48fc6e3ca71e40a526;hp=747ca447efbfe61f5a38aa14865fa1ca319ddd38;hb=aec80a1fb774715e43430ab583c190b79e468fce;hpb=f9d7d3b8561dab3ddfd8798a77a5b72e03ac8c2b diff --git a/tests/phpunit/includes/media/IPTCTest.php b/tests/phpunit/includes/media/IPTCTest.php index 747ca447ef..4b3ba0755c 100644 --- a/tests/phpunit/includes/media/IPTCTest.php +++ b/tests/phpunit/includes/media/IPTCTest.php @@ -15,25 +15,25 @@ class IPTCTest extends MediaWikiTestCase { } /** - * @covers IPTC::Parse + * @covers IPTC::parse */ public function testIPTCParseNoCharset88591() { // basically IPTC for keyword with value of 0xBC which is 1/4 in iso-8859-1 // This data doesn't specify a charset. We're supposed to guess // (which basically means utf-8 if valid, windows 1252 (iso 8859-1) if not) $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x06\x1c\x02\x19\x00\x01\xBC"; - $res = IPTC::Parse( $iptcData ); + $res = IPTC::parse( $iptcData ); $this->assertEquals( [ '¼' ], $res['Keywords'] ); } /** - * @covers IPTC::Parse + * @covers IPTC::parse */ public function testIPTCParseNoCharset88591b() { /* This one contains a sequence that's valid iso 8859-1 but not valid utf8 */ /* \xC3 = Ã, \xB8 = ¸ */ $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x09\x1c\x02\x19\x00\x04\xC3\xC3\xC3\xB8"; - $res = IPTC::Parse( $iptcData ); + $res = IPTC::parse( $iptcData ); $this->assertEquals( [ 'ÃÃø' ], $res['Keywords'] ); } @@ -41,52 +41,45 @@ class IPTCTest extends MediaWikiTestCase { * Same as testIPTCParseNoCharset88591b, but forcing the charset to utf-8. * What should happen is the first "\xC3\xC3" should be dropped as invalid, * leaving \xC3\xB8, which is ø - * @covers IPTC::Parse + * @covers IPTC::parse */ public function testIPTCParseForcedUTFButInvalid() { - if ( version_compare( PHP_VERSION, '5.5.26', '<' ) - || ( version_compare( PHP_VERSION, '5.6.0', '>' ) - && version_compare( PHP_VERSION, '5.6.10', '<' ) - ) - ) { - $this->markTestSkipped( 'Test fails on pre-PHP 5.5.25. See T124574/T39665 for details.' ); - } $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x11\x1c\x02\x19\x00\x04\xC3\xC3\xC3\xB8" . "\x1c\x01\x5A\x00\x03\x1B\x25\x47"; - $res = IPTC::Parse( $iptcData ); + $res = IPTC::parse( $iptcData ); $this->assertEquals( [ 'ø' ], $res['Keywords'] ); } /** - * @covers IPTC::Parse + * @covers IPTC::parse */ public function testIPTCParseNoCharsetUTF8() { $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x07\x1c\x02\x19\x00\x02¼"; - $res = IPTC::Parse( $iptcData ); + $res = IPTC::parse( $iptcData ); $this->assertEquals( [ '¼' ], $res['Keywords'] ); } /** * Testing something that has 2 values for keyword - * @covers IPTC::Parse + * @covers IPTC::parse */ public function testIPTCParseMulti() { $iptcData = /* identifier */ "Photoshop 3.0\08BIM\4\4" /* length */ . "\0\0\0\0\0\x0D" . "\x1c\x02\x19" . "\x00\x01" . "\xBC" . "\x1c\x02\x19" . "\x00\x02" . "\xBC\xBD"; - $res = IPTC::Parse( $iptcData ); + $res = IPTC::parse( $iptcData ); $this->assertEquals( [ '¼', '¼½' ], $res['Keywords'] ); } /** - * @covers IPTC::Parse + * @covers IPTC::parse */ public function testIPTCParseUTF8() { // This has the magic "\x1c\x01\x5A\x00\x03\x1B\x25\x47" which marks content as UTF8. $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x0F\x1c\x02\x19\x00\x02¼\x1c\x01\x5A\x00\x03\x1B\x25\x47"; - $res = IPTC::Parse( $iptcData ); + $res = IPTC::parse( $iptcData ); $this->assertEquals( [ '¼' ], $res['Keywords'] ); } }