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

List of all members.

Protected Member Functions

 doApiRequest (array $params, array $session=null, $appendModule=false, User $user=null)
 Does the API request and returns the result.
 doApiRequestWithToken (array $params, array $session=null, User $user=null)
 Add an edit token to the API request This is cheating a bit -- we grab a token in the correct format and then add it to the pseudo-session and to the request, without actually requesting a "real" edit token.
 doLogin ()
 getTokenList ($user, $session=null)
 setUp ()
 setUp and tearDown should (where significant) happen in reverse order.

Protected Attributes

ApiTestContext $apiContext

Static Protected Attributes

static $apiUrl

Detailed Description

Definition at line 3 of file ApiTestCase.php.


Member Function Documentation

ApiTestCase::doApiRequestWithToken ( array params,
array session = null,
User user = null 
) [protected]

Add an edit token to the API request This is cheating a bit -- we grab a token in the correct format and then add it to the pseudo-session and to the request, without actually requesting a "real" edit token.

Parameters:
$paramsArray: key-value API params
$sessionArray|null: session array
$userUser|null A User object for the context

Definition at line 105 of file ApiTestCase.php.

Referenced by ApiEditPageTest\testEdit(), ApiEditPageTest\testEditAppend(), ApiEditPageTest\testNonTextEdit(), ApiUploadTest\testUpload(), ApiUploadTest\testUploadChunks(), ApiUploadTest\testUploadMissingParams(), ApiUploadTest\testUploadSameContent(), ApiUploadTest\testUploadSameFileName(), ApiUploadTest\testUploadStash(), and ApiUploadTest\testUploadZeroLength().

ApiTestCase::getTokenList ( user,
session = null 
) [protected]

Definition at line 141 of file ApiTestCase.php.

References $user, array(), and doApiRequest().

Referenced by ApiBlockTest\getTokens(), ApiWatchTest\getTokens(), and ApiTest\runTokenTest().

ApiTestCase::setUp ( ) [protected]

setUp and tearDown should (where significant) happen in reverse order.

Reimplemented from MediaWikiLangTestCase.

Reimplemented in ApiTestCaseUpload, ApiWatchTest, ApiBlockTest, ApiParseTest, ApiPurgeTest, ApiQueryTest, and UploadFromUrlTest.

Definition at line 10 of file ApiTestCase.php.

References $wgContLang, $wgMemc, $wgUser, array(), Language\factory(), global, ApiQueryInfo\resetTokenCache(), and wfScript().


Member Data Documentation

ApiTestContext ApiTestCase::$apiContext [protected]

Definition at line 8 of file ApiTestCase.php.

ApiTestCase::$apiUrl [static, protected]

Definition at line 4 of file ApiTestCase.php.


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