Set more FakeDatabaseMysqlBase fields in __construct()
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 21 Sep 2016 21:06:12 +0000 (14:06 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 21 Sep 2016 21:07:24 +0000 (21:07 +0000)
Change-Id: I37a1e4aae186e19637817bd10be0d8fad06187d4

tests/phpunit/includes/db/DatabaseMysqlBaseTest.php

index b2cdc86..9480c2d 100644 (file)
@@ -33,6 +33,12 @@ class FakeDatabaseMysqlBase extends DatabaseMysqlBase {
        function __construct() {
                $this->profiler = new ProfilerStub( [] );
                $this->trxProfiler = new TransactionProfiler();
+               $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();
        }