MediaWiki  REL1_19
ApiTestCaseUpload Class Reference

* Abstract class to support upload tests More...

Inheritance diagram for ApiTestCaseUpload:
Collaboration diagram for ApiTestCaseUpload:

List of all members.

Public Member Functions

 clearFakeUploads ()
 Remove traces of previous fake uploads.
 clearTempUpload ()
 deleteFileByContent ($filePath)
 Helper function -- given a file on the filesystem, find matching content in the db (and associated articles) and remove them.
 deleteFileByFileName ($fileName)
 Helper function -- remove files and associated articles with a particular filename.
 deleteFileByTitle ($title)
 Helper function -- remove files and associated articles by Title.
 fakeUploadChunk ($fieldName, $fileName, $type, &$chunkData)
 fakeUploadFile ($fieldName, $fileName, $type, $filePath)
 Fake an upload by dumping the file into temp space, and adding info to $_FILES.
 setUp ()
 Fixture -- run before every test.
 tearDown ()

Detailed Description

* Abstract class to support upload tests

Definition at line 7 of file ApiTestCaseUpload.php.


Member Function Documentation

Remove traces of previous fake uploads.

Definition at line 141 of file ApiTestCaseUpload.php.

Referenced by setUp(), ApiUploadTest\testUploadChunks(), and ApiUploadTest\testUploadStash().

Here is the caller graph for this function:

Definition at line 129 of file ApiTestCaseUpload.php.

Referenced by tearDown().

Here is the caller graph for this function:

Helper function -- given a file on the filesystem, find matching content in the db (and associated articles) and remove them.

Parameters:
$filePathString: path to file on the filesystem

Definition at line 62 of file ApiTestCaseUpload.php.

References $success, deleteFileByTitle(), FSFile\getSha1Base36FromPath(), and RepoGroup\singleton().

Referenced by ApiUploadTest\testUpload(), ApiUploadTest\testUploadChunks(), ApiUploadTest\testUploadSameContent(), and ApiUploadTest\testUploadStash().

Here is the call graph for this function:

Here is the caller graph for this function:

Helper function -- remove files and associated articles with a particular filename.

Parameters:
$fileNameString: filename to be removed

Definition at line 53 of file ApiTestCaseUpload.php.

References deleteFileByTitle(), and Title\newFromText().

Referenced by ApiUploadTest\testUpload(), ApiUploadTest\testUploadChunks(), ApiUploadTest\testUploadSameContent(), ApiUploadTest\testUploadSameFileName(), ApiUploadTest\testUploadStash(), and ApiUploadTest\testUploadZeroLength().

Here is the call graph for this function:

Here is the caller graph for this function:

Helper function -- remove files and associated articles by Title.

Parameters:
$titleTitle: title to be removed

Definition at line 30 of file ApiTestCaseUpload.php.

References $comment, $file, $page, $title, FileDeleteForm\doDelete(), WikiPage\factory(), Title\newFromText(), and wfFindFile().

Referenced by deleteFileByContent(), and deleteFileByFileName().

Here is the call graph for this function:

Here is the caller graph for this function:

ApiTestCaseUpload::fakeUploadChunk ( fieldName,
fileName,
type,
&$  chunkData 
)

Definition at line 107 of file ApiTestCaseUpload.php.

References $size, and wfTempDir().

Referenced by ApiUploadTest\testUploadChunks().

Here is the call graph for this function:

Here is the caller graph for this function:

ApiTestCaseUpload::fakeUploadFile ( fieldName,
fileName,
type,
filePath 
)

Fake an upload by dumping the file into temp space, and adding info to $_FILES.

(This is what PHP would normally do).

Parameters:
$fieldNameString: name this would have in the upload form
$fileNameString: name to title this
$typeString: mime type
$filePathString: path where to find file contents

Definition at line 80 of file ApiTestCaseUpload.php.

References $size, and wfTempDir().

Referenced by ApiUploadTest\testUpload(), ApiUploadTest\testUploadSameContent(), ApiUploadTest\testUploadSameFileName(), ApiUploadTest\testUploadStash(), and ApiUploadTest\testUploadZeroLength().

Here is the call graph for this function:

Here is the caller graph for this function:

Fixture -- run before every test.

Reimplemented from ApiTestCase.

Definition at line 11 of file ApiTestCaseUpload.php.

References $wgEnableAPI, $wgEnableUploads, clearFakeUploads(), and wfSetupSession().

Here is the call graph for this function:

Reimplemented from MediaWikiLangTestCase.

Definition at line 22 of file ApiTestCaseUpload.php.

References clearTempUpload().

Here is the call graph for this function:


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