<?php
/**
- * Helper for testing the methods from the DatabaseBase class
+ * Helper for testing the methods from the Database class
* @since 1.22
*/
-class DatabaseTestHelper extends DatabaseBase {
+class DatabaseTestHelper extends Database {
/**
* __CLASS__ of the test suite,
/**
* Array of lastSqls passed to query(),
- * This is an array since some methods in DatabaseBase can do more than one
+ * This is an array since some methods in Database can do more than one
* query. Cleared when calling getLastSqls().
*/
protected $lastSqls = [];
$this->profiler = new ProfilerStub( [] );
$this->trxProfiler = new TransactionProfiler();
$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();
}
/**
}
public function tableExists( $table, $fname = __METHOD__ ) {
+ $tableRaw = $this->tableName( $table, 'raw' );
+ if ( isset( $this->mSessionTempTables[$tableRaw] ) ) {
+ return true; // already known to exist
+ }
+
$this->checkFunctionName( $fname );
return in_array( $table, (array)$this->tablesExists );
return false;
}
- function indexInfo( $table, $index, $fname = 'DatabaseBase::indexInfo' ) {
+ function indexInfo( $table, $index, $fname = 'Database::indexInfo' ) {
return false;
}