X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Ffilerepo%2FMigrateFileRepoLayoutTest.php;h=800c2fc76e0e0c6854a0aeac7a3676e6b246f47a;hp=ed80c573a29efb7e0db05116737f4b87de894d88;hb=424251a2cb5842727756d96f877c787c443ea056;hpb=d716155c8b2d6e4a51a4110195cee7a1794846e8 diff --git a/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php b/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php index ed80c573a2..800c2fc76e 100644 --- a/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php +++ b/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php @@ -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 );