Merge "phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat"
[lhc/web/wiklou.git] / tests / phpunit / includes / filerepo / MigrateFileRepoLayoutTest.php
index ed80c57..800c2fc 100644 (file)
@@ -25,7 +25,7 @@ class MigrateFileRepoLayoutTest extends MediaWikiTestCase {
                        ]
                ] );
 
-               $dbMock = $this->getMockBuilder( 'DatabaseMysql' )
+               $dbMock = $this->getMockBuilder( 'DatabaseMysqli' )
                        ->disableOriginalConstructor()
                        ->getMock();
 
@@ -41,25 +41,28 @@ class MigrateFileRepoLayoutTest extends MediaWikiTestCase {
                                new FakeResultWrapper( [] ) // filearchive
                        ) );
 
-               $repoMock = $this->getMock( 'LocalRepo',
-                       [ 'getMasterDB' ],
-                       [ [
-                               'name' => 'migratefilerepolayouttest',
-                               'backend' => $backend
-                       ] ] );
+               $repoMock = $this->getMockBuilder( 'LocalRepo' )
+                       ->setMethods( [ 'getMasterDB' ] )
+                       ->setConstructorArgs( [ [
+                                       'name' => 'migratefilerepolayouttest',
+                                       'backend' => $backend
+                               ] ] )
+                       ->getMock();
 
                $repoMock
                        ->expects( $this->any() )
                        ->method( 'getMasterDB' )
                        ->will( $this->returnValue( $dbMock ) );
 
-               $this->migratorMock = $this->getMock( 'MigrateFileRepoLayout', [ 'getRepo' ] );
+               $this->migratorMock = $this->getMockBuilder( 'MigrateFileRepoLayout' )
+                       ->setMethods( [ 'getRepo' ] )->getMock();
                $this->migratorMock
                        ->expects( $this->any() )
                        ->method( 'getRepo' )
                        ->will( $this->returnValue( $repoMock ) );
 
-               $this->tmpFilepath = TempFSFile::factory( 'migratefilelayout-test-', 'png' )->getPath();
+               $this->tmpFilepath = TempFSFile::factory(
+                       'migratefilelayout-test-', 'png', wfTempDir() )->getPath();
 
                file_put_contents( $this->tmpFilepath, $this->text );