Merge "EditPage::newSectionSummary should return a value in all code paths"
[lhc/web/wiklou.git] / tests / phpunit / includes / media / MediaWikiMediaTestCase.php
index 96347d9..8e56245 100644 (file)
@@ -29,11 +29,18 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase {
                        'wikiId' => wfWikiId(),
                        'containerPaths' => $containers
                ) );
-               $this->repo = new FSRepo( array(
+               $this->repo = new FSRepo( $this->getRepoOptions() );
+       }
+
+       /**
+        * @return Array Argument for FSRepo constructor
+        */
+       protected function getRepoOptions() {
+               return array(
                        'name' => 'temp',
                        'url' => 'http://localhost/thumbtest',
                        'backend' => $this->backend
-               ) );
+               );
        }
 
        /**
@@ -62,8 +69,8 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase {
         * Utility function: Get a new file object for a file on disk but not actually in db.
         *
         * File must be in the path returned by getFilePath()
-        * @param $name String File name
-        * @param $type String MIME type [optional]
+        * @param string $name File name
+        * @param string $type MIME type [optional]
         * @return UnregisteredLocalFile
         */
        protected function dataFile( $name, $type = null ) {
@@ -71,7 +78,7 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase {
                        // Autodetect by file extension for the lazy.
                        $magic = MimeMagic::singleton();
                        $parts = explode( $name, '.' );
-                       $type = $magic->guessTypesForExtension( $parts[count( $parts ) - 1]  );
+                       $type = $magic->guessTypesForExtension( $parts[count( $parts ) - 1] );
                }
                return new UnregisteredLocalFile( false, $this->repo,
                        "mwstore://localtesting/data/$name", $type );