From: Aaron Schulz Date: Wed, 21 Sep 2016 18:56:22 +0000 (-0700) Subject: Set more fields in fake DB subclasses to avoid errors X-Git-Tag: 1.31.0-rc.0~5413^2 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=dc7338be6f8db7541540a443696981f3ca109ea9;p=lhc%2Fweb%2Fwiklou.git Set more fields in fake DB subclasses to avoid errors Change-Id: I6b24422e830a8f82ba24383b3425808cb2a28b15 --- diff --git a/tests/phpunit/includes/db/DatabaseTestHelper.php b/tests/phpunit/includes/db/DatabaseTestHelper.php index 29b2bedbf9..4c3ba10238 100644 --- a/tests/phpunit/includes/db/DatabaseTestHelper.php +++ b/tests/phpunit/includes/db/DatabaseTestHelper.php @@ -36,6 +36,9 @@ class DatabaseTestHelper extends DatabaseBase { $this->cliMode = isset( $opts['cliMode'] ) ? $opts['cliMode'] : true; $this->connLogger = new \Psr\Log\NullLogger(); $this->queryLogger = new \Psr\Log\NullLogger(); + $this->errorLogger = function ( Exception $e ) { + wfWarn( get_class( $e ) . ": {$e->getMessage()}" ); + }; $this->currentDomain = DatabaseDomain::newUnspecified(); } diff --git a/tests/phpunit/includes/installer/DatabaseUpdaterTest.php b/tests/phpunit/includes/installer/DatabaseUpdaterTest.php index 463423907c..f01c47d04e 100644 --- a/tests/phpunit/includes/installer/DatabaseUpdaterTest.php +++ b/tests/phpunit/includes/installer/DatabaseUpdaterTest.php @@ -21,6 +21,12 @@ class FakeDatabase extends DatabaseBase { public $lastInsertData; function __construct() { + $this->cliMode = true; + $this->connLogger = new \Psr\Log\NullLogger(); + $this->queryLogger = new \Psr\Log\NullLogger(); + $this->errorLogger = function ( Exception $e ) { + wfWarn( get_class( $e ) . ": {$e->getMessage()}" ); + }; $this->currentDomain = DatabaseDomain::newUnspecified(); }