MediaWiki  master
UploadFromUrlTest Class Reference

Broken Upload 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

Definition at line 7 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 23 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 Job\pop().

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 deleteFile(), global, wfLocalFile(), and wfSetupSession().

testLogin testClearQueue

Definition at line 152 of file UploadFromUrlTest.php.

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

testLogin testClearQueue

Definition at line 171 of file UploadFromUrlTest.php.

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

Ensure that the job queue is empty before continuing.

Definition at line 38 of file UploadFromUrlTest.php.

References $job, and Job\pop().

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

Definition at line 50 of file UploadFromUrlTest.php.

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

testLogin testClearQueue

Definition at line 78 of file UploadFromUrlTest.php.

References $job, array(), doApiRequest(), Job\pop(), and user.

testLogin testClearQueue

Definition at line 202 of file UploadFromUrlTest.php.

References $job, array(), deleteFile(), doApiRequest(), Job\pop(), and user.


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