Merge "Set more fields in fake DB subclasses to avoid errors"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 21 Sep 2016 20:17:28 +0000 (20:17 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 21 Sep 2016 20:17:28 +0000 (20:17 +0000)
tests/phpunit/includes/db/DatabaseTestHelper.php
tests/phpunit/includes/installer/DatabaseUpdaterTest.php

index fcf4e05..31b692b 100644 (file)
@@ -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();
        }
 
index 4634239..f01c47d 100644 (file)
@@ -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();
        }