From: Antoine Musso Date: Tue, 3 Jan 2017 16:46:29 +0000 (+0100) Subject: tests: mock should not __clone Database X-Git-Tag: 1.31.0-rc.0~4412^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=75b54a58c05c0bfdced5dc2aedbe12c769134670;p=lhc%2Fweb%2Fwiklou.git tests: mock should not __clone Database The Database __clone relies on a connLogger which is set in the constructor. However, when creating a mock of Database, PHPUnit 5.x does a __clone which uses a connLogger. That leads to a fatal error. The sole caller is FileBackendDBRepoWrapperTest, have its mock to skip invoking __clone(). Change-Id: I2ee3b561104bdacc0232ba5e90b3eae3fbaa6f8f --- diff --git a/tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php b/tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php index 410d2df217..6c93c79a4a 100644 --- a/tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php +++ b/tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php @@ -113,6 +113,7 @@ class FileBackendDBRepoWrapperTest extends MediaWikiTestCase { protected function getMocks() { $dbMock = $this->getMockBuilder( 'DatabaseMysqli' ) + ->disableOriginalClone() ->disableOriginalConstructor() ->getMock();