Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
[lhc/web/wiklou.git] / tests / phpunit / includes / db / DatabaseTestHelper.php
index 36254f7..0795609 100644 (file)
@@ -47,12 +47,15 @@ class DatabaseTestHelper extends Database {
 
                $this->profiler = new ProfilerStub( [] );
                $this->trxProfiler = new TransactionProfiler();
-               $this->cliMode = isset( $opts['cliMode'] ) ? $opts['cliMode'] : true;
+               $this->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->deprecationLogger = function ( $msg ) {
+                       wfWarn( $msg );
+               };
                $this->currentDomain = DatabaseDomain::newUnspecified();
                $this->open( 'localhost', 'testuser', 'password', 'testdb' );
        }
@@ -195,9 +198,7 @@ class DatabaseTestHelper extends Database {
        }
 
        protected function wasKnownStatementRollbackError() {
-               return isset( $this->lastError['wasKnownStatementRollbackError'] )
-                       ? $this->lastError['wasKnownStatementRollbackError']
-                       : false;
+               return $this->lastError['wasKnownStatementRollbackError'] ?? false;
        }
 
        function fieldInfo( $table, $field ) {