if ( !wfDl( 'exif' ) ) {
$this->markTestSkipped( "This test needs the exif extension." );
}
- global $wgShowEXIF;
- $this->show = $wgShowEXIF;
- $wgShowEXIF = true;
- global $wgEnableAutoRotation;
- $this->oldAuto = $wgEnableAutoRotation;
- $wgEnableAutoRotation = true;
- }
-
- protected function tearDown() {
- global $wgShowEXIF, $wgEnableAutoRotation;
- $wgShowEXIF = $this->show;
- $wgEnableAutoRotation = $this->oldAuto;
-
- parent::tearDown();
+ $this->setMwGlobals( array(
+ 'wgShowEXIF' => true,
+ 'wgEnableAutoRotation' => true,
+ ) );
}
/**
* @dataProvider provideFilesNoAutoRotate
*/
function testMetadataNoAutoRotate( $name, $type, $info ) {
- global $wgEnableAutoRotation;
- $wgEnableAutoRotation = false;
+ $this->setMwGlobals( 'wgEnableAutoRotation', false );
$file = $this->dataFile( $name, $type );
$this->assertEquals( $info['width'], $file->getWidth(), "$name: width check" );
$this->assertEquals( $info['height'], $file->getHeight(), "$name: height check" );
-
- $wgEnableAutoRotation = true;
}
/**
* @dataProvider provideFilesNoAutoRotate
*/
function testRotationRenderingNoAutoRotate( $name, $type, $info, $thumbs ) {
- global $wgEnableAutoRotation;
- $wgEnableAutoRotation = false;
+ $this->setMwGlobals( 'wgEnableAutoRotation', false );
foreach ( $thumbs as $size => $out ) {
if ( preg_match( '/^(\d+)px$/', $size, $matches ) ) {
$this->assertEquals( $out[1], $gis[1], "$name: thumb actual height check for $size" );
}
}
- $wgEnableAutoRotation = true;
}
public static function provideFilesNoAutoRotate() {