MediaWiki  REL1_22
UploadFromUrlTest Class Reference

Broken Upload Database More...

Inheritance diagram for UploadFromUrlTest:
Collaboration diagram for UploadFromUrlTest:

List of all members.

Public Member Functions

 testAsyncUpload ($data)
 testLogin testClearQueue
 testAsyncUploadWarning ($data)
 testLogin testClearQueue
 testClearQueue ()
 Ensure that the job queue is empty before continuing.
 testLeaveMessage ()
 testLogin ()
 testSetupUrlDownload ($data)
 testLogin testClearQueue
 testSyncDownload ($data)
 testLogin testClearQueue

Protected Member Functions

 deleteFile ($name)
 doApiRequest (array $params, array $unused=null, $appendModule=false, User $user=null)
 Does the API request and returns the result.
 setUp ()
 setUp and tearDown should (where significant) happen in reverse order.

Private Member Functions

 doAsyncUpload ($token, $ignoreWarnings=false, $leaveMessage=false)
 Helper function to perform an async upload, execute the job and fetch the status.

Detailed Description

Broken Upload Database

Definition at line 8 of file UploadFromUrlTest.php.


Member Function Documentation

UploadFromUrlTest::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

  • the result data (array)
  • the request (WebRequest)
  • the session data of the request (array)
  • if $appendModule is true, the Api module $module
Parameters:
array$params
array | null$session
bool$appendModule
User | null$user
Returns:
array

Reimplemented from ApiTestCase.

Definition at line 24 of file UploadFromUrlTest.php.

References array(), and wfSetupSession().

Referenced by doAsyncUpload(), testAsyncUploadWarning(), testLeaveMessage(), testLogin(), testSetupUrlDownload(), and testSyncDownload().

UploadFromUrlTest::doAsyncUpload ( token,
ignoreWarnings = false,
leaveMessage = false 
) [private]

Helper function to perform an async upload, execute the job and fetch the status.

Returns:
array The result of action=upload&statuskey=key

Definition at line 297 of file UploadFromUrlTest.php.

References $job, $params, array(), doApiRequest(), and JobQueueGroup\singleton().

Referenced by testAsyncUpload(), and testAsyncUploadWarning().

UploadFromUrlTest::setUp ( ) [protected]

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

Reimplemented from ApiTestCase.

Definition at line 9 of file UploadFromUrlTest.php.

References array(), deleteFile(), MediaWikiTestCase\setMwGlobals(), wfLocalFile(), and wfSetupSession().

testLogin testClearQueue

Definition at line 154 of file UploadFromUrlTest.php.

References deleteFile(), doAsyncUpload(), user, and wfLocalFile().

testLogin testClearQueue

Definition at line 173 of file UploadFromUrlTest.php.

References array(), deleteFile(), doApiRequest(), doAsyncUpload(), user, and wfLocalFile().

Ensure that the job queue is empty before continuing.

Definition at line 40 of file UploadFromUrlTest.php.

References $job, and JobQueueGroup\singleton().

Todo:
Document why we test login, since the $wgUser hack used doesn't require login

Definition at line 52 of file UploadFromUrlTest.php.

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

testLogin testClearQueue

Definition at line 80 of file UploadFromUrlTest.php.

References $job, array(), doApiRequest(), JobQueueGroup\singleton(), and user.

testLogin testClearQueue

Definition at line 203 of file UploadFromUrlTest.php.

References $job, array(), deleteFile(), doApiRequest(), JobQueueGroup\singleton(), and user.


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