Merge "(bug 47070) check content model namespace on import."
[lhc/web/wiklou.git] / tests / phpunit / includes / filerepo / StoreBatchTest.php
index 71a585e..8fb85b6 100644 (file)
@@ -1,10 +1,16 @@
 <?php
+
 /**
  * @group FileRepo
  * @group medium
  */
 class StoreBatchTest extends MediaWikiTestCase {
 
+       protected $createdFiles;
+       protected $date;
+       /** @var FileRepo */
+       protected $repo;
+
        protected function setUp() {
                global $wgFileBackends;
                parent::setUp();
@@ -19,13 +25,15 @@ class StoreBatchTest extends MediaWikiTestCase {
                                        $useConfig = $conf;
                                }
                        }
+                       $useConfig['lockManager'] = LockManagerGroup::singleton()->get( $useConfig['lockManager'] );
+                       unset( $useConfig['fileJournal'] );
                        $useConfig['name'] = 'local-testing'; // swap name
                        $class = $useConfig['class'];
                        $backend = new $class( $useConfig );
                } else {
                        $backend = new FSFileBackend( array(
                                'name' => 'local-testing',
-                               'lockManager' => 'nullLockManager',
+                               'wikiId' => wfWikiID(),
                                'containerPaths' => array(
                                        'unittests-public' => "{$tmpPrefix}-public",
                                        'unittests-thumb' => "{$tmpPrefix}-thumb",
@@ -60,6 +68,7 @@ class StoreBatchTest extends MediaWikiTestCase {
         * @param $originalName string The title of the image
         * @param $srcPath string The filepath or virtual URL
         * @param $flags integer Flags to pass into repo::store().
+        * @return FileRepoStatus
         */
        private function storeit( $originalName, $srcPath, $flags ) {
                $hashPath = $this->repo->getHashPath( $originalName );
@@ -79,7 +88,7 @@ class StoreBatchTest extends MediaWikiTestCase {
         * @param $fn string The title of the image
         * @param $infn string The name of the file (in the filesystem)
         * @param $otherfn string The name of the different file (in the filesystem)
-        * @param $fromrepo logical 'true' if we want to copy from a virtual URL out of the Repo.
+        * @param $fromrepo bool 'true' if we want to copy from a virtual URL out of the Repo.
         */
        private function storecohort( $fn, $infn, $otherfn, $fromrepo ) {
                $f = $this->storeit( $fn, $infn, 0 );
@@ -116,6 +125,9 @@ class StoreBatchTest extends MediaWikiTestCase {
                $this->assertEquals( $f->successCount, 0, "counts wrong {$f->successCount} {$f->failCount}" );
        }
 
+       /**
+        * @covers FileRepo::store
+        */
        public function teststore() {
                global $IP;
                $this->storecohort( "Test1.png", "$IP/skins/monobook/wiki.png", "$IP/skins/monobook/video.png", false );