MediaWiki
REL1_22
|
Public Member Functions | |
testApiTestGroup () | |
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 ($user= 'sysop') | |
editPage ($pageName, $text, $summary= '', $defaultNs=NS_MAIN) | |
Edits or creates a page/revision. | |
getTokenList ($user, $session=null) | |
setUp () | |
setUp and tearDown should (where significant) happen in reverse order. | |
Protected Attributes | |
ApiTestContext | $apiContext |
Static Protected Attributes | |
static | $apiUrl |
Definition at line 3 of file ApiTestCase.php.
ApiTestCase::doApiRequest | ( | array $ | params, |
array $ | session = null , |
||
$ | appendModule = false , |
||
User $ | user = null |
||
) | [protected] |
Does the API request and returns the result.
The returned value is an array containing
array | $params | |
array | null | $session | |
bool | $appendModule | |
User | null | $user |
Reimplemented in UploadFromUrlTest.
Definition at line 74 of file ApiTestCase.php.
Referenced by ApiFormatTestBase\apiRequest(), ApiQueryTestBase\check(), doLogin(), getTokenList(), ApiQueryContinueTestBase\query(), ApiTest\testApiLoginBadPass(), ApiTest\testApiLoginGoodPass(), ApiTest\testApiLoginNoName(), ApiBlockTest\testBlockingActionWithNoToken(), ApiQueryRevisionsTest\testContentComesWithContentModelAndFormat(), ApiCreateAccountTest\testExistingUser(), ApiWatchTest\testGetRollbackToken(), ApiCreateAccountTest\testInvalidEmail(), ApiUploadTest\testLogin(), ApiBlockTest\testMakeNormalBlock(), ApiCreateAccountTest\testNoName(), ApiCreateAccountTest\testNoPassword(), ApiParseTest\testParseNonexistentPage(), ApiPurgeTest\testPurgeMainPage(), ApiTest\testRunLogin(), ApiQueryTest\testTitlesAreRejectedIfInvalid(), ApiQueryTest\testTitlesGetNormalized(), ApiUploadTest\testUploadRequiresToken(), ApiCreateAccountTest\testValid(), ApiWatchTest\testWatchClear(), ApiWatchTest\testWatchEdit(), ApiWatchTest\testWatchProtect(), and ApiWatchTest\testWatchRollback().
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.
$params | Array: key-value API params |
$session | Array|null: session array |
$user | User|null A User object for the context |
Exception | in case wsToken is not set in the session |
Definition at line 122 of file ApiTestCase.php.
Referenced by ApiEditPageTest\testEdit(), ApiEditPageTest\testEditAppend(), ApiEditPageTest\testEditConflict(), ApiEditPageTest\testEditConflict_bug41990(), ApiEditPageTest\testEditConflict_redirect(), ApiEditPageTest\testEditNewSection(), ApiEditPageTest\testEditSection(), ApiEditPageTest\testNonTextEdit(), ApiUploadTest\testUpload(), ApiUploadTest\testUploadChunks(), ApiUploadTest\testUploadMissingParams(), ApiUploadTest\testUploadSameContent(), ApiUploadTest\testUploadSameFileName(), ApiUploadTest\testUploadStash(), and ApiUploadTest\testUploadZeroLength().
ApiTestCase::doLogin | ( | $ | user = 'sysop' | ) | [protected] |
Definition at line 141 of file ApiTestCase.php.
References $user, array(), and doApiRequest().
Referenced by ApiBlockTest\setUp(), ApiQueryTest\setUp(), ApiWatchTest\setUp(), ApiPurgeTest\setUp(), and ApiParseTest\setUp().
ApiTestCase::editPage | ( | $ | pageName, |
$ | text, | ||
$ | summary = '' , |
||
$ | defaultNs = NS_MAIN |
||
) | [protected] |
Edits or creates a page/revision.
$pageName | string page title |
$text | string content of the page |
$summary | string optional summary string for the revision |
$defaultNs | int optional namespace id |
Definition at line 51 of file ApiTestCase.php.
Referenced by ApiQueryContinue2Test\addDBData(), ApiQueryContinueTest\addDBData(), ApiQueryBasicTest\addDBData(), and ApiQueryBasicTest\testGeneratorRedirects().
ApiTestCase::getTokenList | ( | $ | user, |
$ | session = null |
||
) | [protected] |
Definition at line 166 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 ApiEditPageTest, ApiTestCaseUpload, ApiParseTest, ApiPurgeTest, ApiWatchTest, ApiQueryTest, ApiCreateAccountTest, ApiBlockTest, and UploadFromUrlTest.
Definition at line 10 of file ApiTestCase.php.
References array(), global, ApiQueryInfo\resetTokenCache(), MediaWikiTestCase\setMwGlobals(), user, and wfScript().
Definition at line 179 of file ApiTestCase.php.
ApiTestContext ApiTestCase::$apiContext [protected] |
Definition at line 8 of file ApiTestCase.php.
ApiTestCase::$apiUrl [static, protected] |
Definition at line 4 of file ApiTestCase.php.