Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / includes / api / ApiTestContext.php
blob23d3299f711bcffcbc1bb16a82f0cc7dce5c09e3
1 <?php
3 namespace MediaWiki\Tests\Api;
5 use MediaWiki\Context\DerivativeContext;
6 use MediaWiki\Context\RequestContext;
7 use MediaWiki\Permissions\Authority;
8 use MediaWiki\Request\WebRequest;
10 class ApiTestContext extends RequestContext {
12 /**
13 * Returns a DerivativeContext with the request variables in place
15 * @param WebRequest $request WebRequest request object including parameters and session
16 * @param Authority|null $performer
17 * @return DerivativeContext
19 public function newTestContext( WebRequest $request, ?Authority $performer = null ) {
20 $context = new DerivativeContext( $this );
21 $context->setRequest( $request );
22 if ( $performer !== null ) {
23 $context->setAuthority( $performer );
26 return $context;
30 /** @deprecated class alias since 1.42 */
31 class_alias( ApiTestContext::class, 'ApiTestContext' );