X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fmedia%2FXMPTest.php;h=9ec5796dd32dd92ea470cb643c61addb9feca217;hb=98a0e7d68b3a56268b72f5eba271babef064fd1a;hp=3e39675f44471339b05fb7d3beb9091245534c74;hpb=59f06176c3598c9ed46ed4f08317a656f0e82b62;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/media/XMPTest.php b/tests/phpunit/includes/media/XMPTest.php index 3e39675f44..9ec5796dd3 100644 --- a/tests/phpunit/includes/media/XMPTest.php +++ b/tests/phpunit/includes/media/XMPTest.php @@ -1,9 +1,13 @@ markTestSkipped( 'Requires libxml to do XMP parsing' ); } } @@ -15,7 +19,10 @@ class XMPTest extends MediaWikiTestCase { * @param $expected Array expected result of parsing the xmp. * @param $info String Short sentence on what's being tested. * + * @throws Exception * @dataProvider provideXMPParse + * + * @covers XMPReader::parse */ public function testXMPParse( $xmp, $expected, $info ) { if ( !is_string( $xmp ) || !is_array( $expected ) ) { @@ -62,7 +69,7 @@ class XMPTest extends MediaWikiTestCase { // result array, but it seems kind of big to put directly in the test // file. $result = null; - include( $xmpPath . $file[0] . '.result.php' ); + include $xmpPath . $file[0] . '.result.php'; $data[] = array( $xmp, $result, '[' . $file[0] . '.xmp] ' . $file[1] ); } @@ -74,8 +81,10 @@ class XMPTest extends MediaWikiTestCase { * * @todo This is based on what the standard says. Need to find a real * world example file to double check the support for this is right. + * + * @covers XMPReader::parseExtended */ - function testExtendedXMP() { + public function testExtendedXMP() { $xmpPath = __DIR__ . '/../../data/xmp/'; $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' ); $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' ); @@ -104,8 +113,10 @@ class XMPTest extends MediaWikiTestCase { /** * This test has an extended XMP block with a wrong guid (md5sum) * and thus should only return the StandardXMP, not the ExtendedXMP. + * + * @covers XMPReader::parseExtended */ - function testExtendedXMPWithWrongGUID() { + public function testExtendedXMPWithWrongGUID() { $xmpPath = __DIR__ . '/../../data/xmp/'; $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' ); $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' ); @@ -133,8 +144,10 @@ class XMPTest extends MediaWikiTestCase { /** * Have a high offset to simulate a missing packet, * which should cause it to ignore the ExtendedXMP packet. + * + * @covers XMPReader::parseExtended */ - function testExtendedXMPMissingPacket() { + public function testExtendedXMPMissingPacket() { $xmpPath = __DIR__ . '/../../data/xmp/'; $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' ); $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );