Set more fields in fake DB subclasses to avoid errors
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 21 Sep 2016 18:56:22 +0000 (11:56 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 21 Sep 2016 18:56:28 +0000 (11:56 -0700)
Change-Id: I6b24422e830a8f82ba24383b3425808cb2a28b15

tests/phpunit/includes/db/DatabaseTestHelper.php
tests/phpunit/includes/installer/DatabaseUpdaterTest.php

index 29b2bed..4c3ba10 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();
        }