3 class ApiTestContext
extends RequestContext
{
6 * Returns a DerivativeContext with the request variables in place
8 * @param WebRequest $request WebRequest request object including parameters and session
9 * @param User|null $user User or null
10 * @return DerivativeContext
12 public function newTestContext( WebRequest
$request, User
$user = null ) {
13 $context = new DerivativeContext( $this );
14 $context->setRequest( $request );
15 if ( $user !== null ) {
16 $context->setUser( $user );