From 75b54a58c05c0bfdced5dc2aedbe12c769134670 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 3 Jan 2017 17:46:29 +0100 Subject: [PATCH] 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 --- tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php | 1 + 1 file changed, 1 insertion(+) 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(); -- 2.20.1