public function testSetCacheModeUnrecognized() {
$api = new ApiMain();
$api->setCacheMode( 'unrecognized' );
- $this->overrideMwServices();
+ $this->resetServices();
$this->assertSame(
'private',
TestingAccessWrapper::newFromObject( $api )->mCacheMode,
public function testSetCacheModePrivateWiki() {
$this->setGroupPermissions( '*', 'read', false );
- $this->overrideMwServices();
$wrappedApi = TestingAccessWrapper::newFromObject( new ApiMain() );
$wrappedApi->setCacheMode( 'public' );
$this->assertSame( 'private', $wrappedApi->mCacheMode );
$this->assertTrue( self::apiExceptionHasCode( $e, $error ),
"Error '{$e->getMessage()}' matched expected '$error'" );
}
- $this->overrideMwServices();
}
/**
'You need read permission to use this module.' );
$this->setGroupPermissions( '*', 'read', false );
- $this->overrideMwServices();
$main = new ApiMain( new FauxRequest( [ 'action' => 'query', 'meta' => 'siteinfo' ] ) );
$main->execute();
$this->setExpectedException( ApiUsageException::class,
"You're not allowed to edit this wiki through the API." );
$this->setGroupPermissions( '*', 'writeapi', false );
- $this->overrideMwServices();
$main = new ApiMain( new FauxRequest( [
'action' => 'edit',