X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fmedia%2FJpegTest.php;h=2436e7d901a1831da5f1c11ce98b0f617437ebdf;hb=f718e7710aa34dd88670e14203e00dc24cf6f1d3;hp=1b28de1dd078da8aa48582e3620c389cde3a064d;hpb=55605dfbeea865cacb2299271ddec4716799061d;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/media/JpegTest.php b/tests/phpunit/includes/media/JpegTest.php index 1b28de1dd0..2436e7d901 100644 --- a/tests/phpunit/includes/media/JpegTest.php +++ b/tests/phpunit/includes/media/JpegTest.php @@ -1,30 +1,17 @@ checkPHPExtension( 'exif' ); - $this->filePath = __DIR__ . '/../../data/media/'; - $this->setMwGlobals( 'wgShowEXIF', true ); - $this->backend = new FSFileBackend( array( - 'name' => 'localtesting', - 'wikiId' => wfWikiId(), - 'containerPaths' => array( 'data' => $this->filePath ) - ) ); - $this->repo = new FSRepo( array( - 'name' => 'temp', - 'url' => 'http://localhost/thumbtest', - 'backend' => $this->backend - ) ); - $this->handler = new JpegHandler; } @@ -37,7 +24,9 @@ class JpegTest extends MediaWikiTestCase { public function testJpegMetadataExtraction() { $file = $this->dataFile( 'test.jpg', 'image/jpeg' ); $res = $this->handler->getMetadata( $file, $this->filePath . 'test.jpg' ); + // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong $expected = 'a:7:{s:16:"ImageDescription";s:9:"Test file";s:11:"XResolution";s:4:"72/1";s:11:"YResolution";s:4:"72/1";s:14:"ResolutionUnit";i:2;s:16:"YCbCrPositioning";i:1;s:15:"JPEGFileComment";a:1:{i:0;s:17:"Created with GIMP";}s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}'; + // @codingStandardsIgnoreEnd // Unserialize in case serialization format ever changes. $this->assertEquals( unserialize( $expected ), unserialize( $res ) ); @@ -62,9 +51,4 @@ class JpegTest extends MediaWikiTestCase { $this->assertEquals( $res, $expected ); } - - private function dataFile( $name, $type ) { - return new UnregisteredLocalFile( false, $this->repo, - "mwstore://localtesting/data/$name", $type ); - } }