<?php
+use MediaWiki\Block\DatabaseBlock;
+
/**
* @covers LocalIdLookup
* @group Database
private $localUsers = [];
protected function setUp() {
- global $wgGroupPermissions;
-
parent::setUp();
- $this->stashMwGlobals( [ 'wgGroupPermissions' ] );
- $wgGroupPermissions['local-id-lookup-test']['hideuser'] = true;
+ $this->setGroupPermissions( 'local-id-lookup-test', 'hideuser', true );
+ $this->overrideMwServices();
}
public function addDBData() {
$sysop = static::getTestSysop()->getUser();
- $block = new Block( [
+ $block = new DatabaseBlock( [
'address' => $this->localUsers[2]->getName(),
'by' => $sysop->getId(),
'reason' => __METHOD__,
] );
$block->insert();
- $block = new Block( [
+ $block = new DatabaseBlock( [
'address' => $this->localUsers[3]->getName(),
'by' => $sysop->getId(),
'reason' => __METHOD__,
* @param bool $localDBSet $wgLocalDatabases contains the shared DB
*/
public function testIsAttachedShared( $sharedDB, $sharedTable, $localDBSet ) {
- global $wgDBName;
$this->setMwGlobals( [
- 'wgSharedDB' => $sharedDB ? $wgDBName : null,
+ 'wgSharedDB' => $sharedDB ? "dummy" : null,
'wgSharedTables' => $sharedTable ? [ 'user' ] : [],
'wgLocalDatabases' => $localDBSet ? [ 'shared' ] : [],
] );