Exemplo n.º 1
0
 /**
  * @dataProvider provideSwappingICCProfile
  * @covers BitmapHandler::swapICCProfile
  */
 public function testSwappingICCProfile($sourceFilename, $controlFilename, $newProfileFilename, $oldProfileName)
 {
     global $wgExiftool;
     if (!$wgExiftool || !is_file($wgExiftool)) {
         $this->markTestSkipped("Exiftool not installed, cannot test ICC profile swapping");
     }
     $this->setMwGlobals('wgUseTinyRGBForJPGThumbnails', true);
     $sourceFilepath = $this->filePath . $sourceFilename;
     $controlFilepath = $this->filePath . $controlFilename;
     $profileFilepath = $this->filePath . $newProfileFilename;
     $filepath = $this->getNewTempFile();
     copy($sourceFilepath, $filepath);
     $file = $this->dataFile($sourceFilename, 'image/jpeg');
     $this->handler->swapICCProfile($filepath, $oldProfileName, $profileFilepath);
     $this->assertEquals(sha1(file_get_contents($filepath)), sha1(file_get_contents($controlFilepath)));
 }