require __DIR__ . '/../../maintenance/Maintenance.php';
+use MediaWiki\MediaWikiServices;
+
class ParserTestsMaintenance extends Maintenance {
function __construct() {
parent::__construct();
}
public function execute() {
- global $wgParserTestFiles, $wgDBtype;
+ global $wgDBtype;
// Cases of weird db corruption were encountered when running tests on earlyish
// versions of SQLite
$recorderLB = false;
if ( $record || $compare ) {
- $recorderLB = wfGetLBFactory()->newMainLB();
+ $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+ $recorderLB = $lbFactory->newMainLB();
// This connection will have the wiki's table prefix, not parsertest_
$recorderDB = $recorderLB->getConnection( DB_MASTER );
}
// Default parser tests and any set from extensions or local config
- $files = $this->getOption( 'file', $wgParserTestFiles );
+ $files = $this->getOption( 'file', ParserTestRunner::getParserTestFiles() );
$norm = $this->hasOption( 'norm' ) ? explode( ',', $this->getOption( 'norm' ) ) : [];