MediaWiki REL1_33
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.
 
- Public Member Functions inherited from RequestContext
 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage().
 
 exportSession ()
 Export the resolved user IP, HTTP headers, user ID, and session ID.
 
 getConfig ()
 
 getLanguage ()
 Get the Language object.
 
 getOutput ()
 
 getRequest ()
 
 getSkin ()
 
 getStats ()
 
 getTiming ()
 
 getTitle ()
 
 getUser ()
 
 getWikiPage ()
 Get the WikiPage object.
 
 hasTitle ()
 Check, if a Title object is set.
 
 msg ( $key)
 Get a Message object with context set Parameters are the same as wfMessage()
 
 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.
 
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.
 
static importScopedSession (array $params)
 Import an client IP address, HTTP headers, user ID, and session ID.
 
static newExtraneousContext (Title $title, $request=[])
 Create a new extraneous context.
 
static resetMain ()
 Resets singleton returned by getMain().
 
static sanitizeLangCode ( $code)
 Accepts a language code and ensures it's sane.
 

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


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