MediaWiki  master
ApiTestContext Class Reference
Inheritance diagram for ApiTestContext:
Collaboration diagram for ApiTestContext:

Public Member Functions

 newTestContext (WebRequest $request, User $user=null)
 Returns a DerivativeContext with the request variables in place. More...
 
- Public Member Functions inherited from RequestContext
 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage(). More...
 
 exportSession ()
 Export the resolved user IP, HTTP headers, user ID, and session ID. More...
 
 getConfig ()
 
 getLanguage ()
 Get the Language object. More...
 
 getOutput ()
 
 getRequest ()
 
 getSkin ()
 
 getStats ()
 
 getTiming ()
 
 getTitle ()
 
 getUser ()
 
 getWikiPage ()
 Get the WikiPage object. More...
 
 hasTitle ()
 Check, if a Title object is set. More...
 
 msg ( $key)
 Get a Message object with context set Parameters are the same as wfMessage() More...
 
 setConfig (Config $config)
 
 setLanguage ( $language)
 
 setOutput (OutputPage $output)
 
 setRequest (WebRequest $request)
 
 setSkin (Skin $skin)
 
 setTitle (Title $title=null)
 
 setUser (User $user)
 
 setWikiPage (WikiPage $wikiPage)
 

Additional Inherited Members

- Static Public Member Functions inherited from RequestContext
static getMain ()
 Get the RequestContext object associated with the main request. More...
 
static getMainAndWarn ( $func=__METHOD__)
 Get the RequestContext object associated with the main request and gives a warning to the log, to find places, where a context maybe is missing. More...
 
static importScopedSession (array $params)
 Import an client IP address, HTTP headers, user ID, and session ID. More...
 
static newExtraneousContext (Title $title, $request=[])
 Create a new extraneous context. More...
 
static resetMain ()
 Resets singleton returned by getMain(). More...
 
static sanitizeLangCode ( $code)
 Accepts a language code and ensures it's sane. More...
 

Detailed Description

Definition at line 3 of file ApiTestContext.php.

Member Function Documentation

◆ newTestContext()

ApiTestContext::newTestContext ( WebRequest  $request,
User  $user = null 
)

Returns a DerivativeContext with the request variables in place.

Parameters
WebRequest$requestWebRequest request object including parameters and session
User | null$userUser or null
Returns
DerivativeContext

Definition at line 12 of file ApiTestContext.php.

References $context, RequestContext\$user, and null.


The documentation for this class was generated from the following file: