diff options
Diffstat (limited to 'tests/phpunit/includes/media/GIFMetadataExtractorTest.php')
-rw-r--r-- | tests/phpunit/includes/media/GIFMetadataExtractorTest.php | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/tests/phpunit/includes/media/GIFMetadataExtractorTest.php b/tests/phpunit/includes/media/GIFMetadataExtractorTest.php index 650fdd5c..9e3f9244 100644 --- a/tests/phpunit/includes/media/GIFMetadataExtractorTest.php +++ b/tests/phpunit/includes/media/GIFMetadataExtractorTest.php @@ -1,20 +1,25 @@ <?php class GIFMetadataExtractorTest extends MediaWikiTestCase { - public function setUp() { + protected function setUp() { + parent::setUp(); + $this->mediaPath = __DIR__ . '/../../data/media/'; } + /** * Put in a file, and see if the metadata coming out is as expected. * @param $filename String * @param $expected Array The extracted metadata. - * @dataProvider dataGetMetadata + * @dataProvider provideGetMetadata + * @covers GIFMetadataExtractor::getMetadata */ public function testGetMetadata( $filename, $expected ) { $actual = GIFMetadataExtractor::getMetadata( $this->mediaPath . $filename ); $this->assertEquals( $expected, $actual ); } - public function dataGetMetadata() { + + public static function provideGetMetadata() { $xmpNugget = <<<EOF <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?> @@ -66,29 +71,35 @@ EOF; $xmpNugget = str_replace( "\r", '', $xmpNugget ); // Windows compat return array( - array( 'nonanimated.gif', array( - 'comment' => array( 'GIF test file ⁕ Created with GIMP' ), - 'duration' => 0.1, - 'frameCount' => 1, - 'looped' => false, - 'xmp' => '', + array( + 'nonanimated.gif', + array( + 'comment' => array( 'GIF test file ⁕ Created with GIMP' ), + 'duration' => 0.1, + 'frameCount' => 1, + 'looped' => false, + 'xmp' => '', ) ), - array( 'animated.gif', array( - 'comment' => array( 'GIF test file . Created with GIMP' ), - 'duration' => 2.4, - 'frameCount' => 4, - 'looped' => true, - 'xmp' => '', + array( + 'animated.gif', + array( + 'comment' => array( 'GIF test file . Created with GIMP' ), + 'duration' => 2.4, + 'frameCount' => 4, + 'looped' => true, + 'xmp' => '', ) ), - array( 'animated-xmp.gif', array( - 'xmp' => $xmpNugget, - 'duration' => 2.4, - 'frameCount' => 4, - 'looped' => true, - 'comment' => array( 'GIƒ·test·file' ), + array( + 'animated-xmp.gif', + array( + 'xmp' => $xmpNugget, + 'duration' => 2.4, + 'frameCount' => 4, + 'looped' => true, + 'comment' => array( 'GIƒ·test·file' ), ) ), ); |