Employing MediaWikiTestCase's temporary file methods
[lhc/web/wiklou.git] / tests / phpunit / includes / media / ExifRotationTest.php
index 6cabd9a..1e2d1bb 100644 (file)
@@ -9,16 +9,17 @@ class ExifRotationTest extends MediaWikiTestCase {
                parent::setUp();
                $this->handler = new BitmapHandler();
                $filePath = dirname( __FILE__ ) . '/../../data/media';
-               $tmpDir = wfTempDir() . '/exif-test-' . time() . '-' . mt_rand();
-               $this->backend = new FSFileBackend( array(
-                       'name'           => 'localtesting',
-                       'lockManager'    => 'nullLockManager',
-                       'containerPaths' => array( 'images-thumb' => $tmpDir, 'data' => $filePath )
-               ) );
+
+               $tmpDir = $this->getNewTempDirectory();
+
                $this->repo = new FSRepo( array(
                        'name'            => 'temp',
                        'url'             => 'http://localhost/thumbtest',
-                       'backend'         => $this->backend
+                       'backend'         => new FSFileBackend( array(
+                               'name'           => 'localtesting',
+                               'lockManager'    => 'nullLockManager',
+                               'containerPaths' => array( 'temp-thumb' => $tmpDir, 'data' => $filePath )
+                       ) )
                ) );
                if ( !wfDl( 'exif' ) ) {
                        $this->markTestSkipped( "This test needs the exif extension." );
@@ -31,10 +32,13 @@ class ExifRotationTest extends MediaWikiTestCase {
                $this->oldAuto = $wgEnableAutoRotation;
                $wgEnableAutoRotation = true;
        }
+
        public function tearDown() {
                global $wgShowEXIF, $wgEnableAutoRotation;
                $wgShowEXIF = $this->show;
                $wgEnableAutoRotation = $this->oldAuto;
+
+               parent::tearDown();
        }
 
        /**