CACHE_ACCEL => $hashCache,
CACHE_MEMCACHED => $hashCache,
'apc' => $hashCache,
+ 'apcu' => $hashCache,
'xcache' => $hashCache,
'wincache' => $hashCache,
] + $baseConfig->get( 'ObjectCaches' );
/**
* Make sure MediaWikiTestCase extending classes have called their
* parent setUp method
+ *
+ * With strict coverage activated in PHP_CodeCoverage, this test would be
+ * marked as risky without the following annotation (T152923).
+ * @coversNothing
*/
final public function testMediaWikiTestCaseParentSetupCalled() {
$this->assertArrayHasKey( 'setUp', $this->called,
* Clones all tables in the given database (whatever database that connection has
* open), to versions with the test prefix.
*
- * @param Database $db Database to use
+ * @param IMaintainableDatabase $db Database to use
* @param string $prefix Prefix to use for test tables
* @return bool True if tables were cloned, false if only the prefix was changed
*/
- protected static function setupDatabaseWithTestPrefix( Database $db, $prefix ) {
+ protected static function setupDatabaseWithTestPrefix( IMaintainableDatabase $db, $prefix ) {
$tablesCloned = self::listTables( $db );
$dbClone = new CloneDatabase( $db, $tablesCloned, $prefix );
$dbClone->useTemporaryTables( self::$useTemporaryTables );
list( $proto, $cluster ) = explode( '://', $url, 2 );
// Avoid getMaster() because setupDatabaseWithTestPrefix()
// requires Database instead of plain DBConnRef/IDatabase
- $lb = $externalStoreDB->getLoadBalancer( $cluster );
- $dbw = $lb->getConnection( DB_MASTER );
- $dbws[] = $dbw;
+ $dbws[] = $externalStoreDB->getMaster( $cluster );
}
}
/**
* @since 1.18
*
- * @param Database $db
+ * @param IMaintainableDatabase $db
*
* @return array
*/
- public static function listTables( Database $db ) {
+ public static function listTables( IMaintainableDatabase $db ) {
$prefix = $db->tablePrefix();
$tables = $db->listTables( $prefix, __METHOD__ );
if ( isset( PHPUnitMaintClass::$additionalOptions[$offset] ) ) {
return PHPUnitMaintClass::$additionalOptions[$offset];
}
+
+ return null;
}
/**