MediaWiki  1.28.0
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 ()
 Get the Config object. More...
 
 getLanguage ()
 Get the Language object. More...
 
 getOutput ()
 Get the OutputPage object. More...
 
 getRequest ()
 Get the WebRequest object. More...
 
 getSkin ()
 Get the Skin object. More...
 
 getStats ()
 Get the Stats object. More...
 
 getTiming ()
 Get the timing object. More...
 
 getTitle ()
 Get the Title object. More...
 
 getUser ()
 Get the User object. More...
 
 getWikiPage ()
 Get the WikiPage object. More...
 
 hasTitle ()
 Check, if a Title object is set. More...
 
 msg ()
 Helpful methods. More...
 
 setConfig (Config $c)
 Set the Config object. More...
 
 setLanguage ($l)
 Set the Language object. More...
 
 setOutput (OutputPage $o)
 
 setRequest (WebRequest $r)
 Set the WebRequest object. More...
 
 setSkin (Skin $s)
 Set the Skin object. More...
 
 setTitle (Title $title=null)
 Set the Title object. More...
 
 setUser (User $u)
 Set the User object. More...
 
 setWikiPage (WikiPage $p)
 Set the WikiPage object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from RequestContext
static getMain ()
 Static methods. 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

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, and RequestContext\$user.


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