protected $dbClone;
protected $oldTablePrefix;
protected $useTemporaryTables = true;
+
+ protected $supportedDBs = array(
+ 'mysql',
+ 'sqlite'
+ );
function __construct( $name = null, array $data = array(), $dataName = '' ) {
if ($name !== null) {
global $wgDBprefix;
$this->db = wfGetDB( DB_MASTER );
+
+ $this->checkDbIsSupported();
+
$this->oldTablePrefix = $wgDBprefix;
$this->destroyDB();
return $tables;
}
+
+ protected function checkDbIsSupported() {
+ if( !in_array( $this->db->getType(), $this->supportedDBs ) ) {
+ throw new MWException( $this->db->getType() . " is not currently supported for unit testing." );
+ }
+ }
}