MediaWiki
REL1_22
|
* Abstract class to support upload tests More...
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. | |
Protected Member Functions | |
setUp () | |
Fixture -- run before every test. | |
tearDown () |
* Abstract class to support upload tests
Definition at line 7 of file ApiTestCaseUpload.php.
Remove traces of previous fake uploads.
Definition at line 146 of file ApiTestCaseUpload.php.
References array().
Referenced by setUp(), ApiUploadTest\testUploadChunks(), and ApiUploadTest\testUploadStash().
Definition at line 134 of file ApiTestCaseUpload.php.
Referenced by tearDown().
ApiTestCaseUpload::deleteFileByContent | ( | $ | filePath | ) |
Helper function -- given a file on the filesystem, find matching content in the db (and associated articles) and remove them.
$filePath | String: path to file on the filesystem |
Definition at line 66 of file ApiTestCaseUpload.php.
References $hash, $success, as, deleteFileByTitle(), FSFile\getSha1Base36FromPath(), and RepoGroup\singleton().
Referenced by ApiUploadTest\testUpload(), ApiUploadTest\testUploadChunks(), ApiUploadTest\testUploadSameContent(), and ApiUploadTest\testUploadStash().
ApiTestCaseUpload::deleteFileByFileName | ( | $ | fileName | ) |
Helper function -- remove files and associated articles with a particular filename.
$fileName | String: filename to be removed |
Definition at line 58 of file ApiTestCaseUpload.php.
References deleteFileByTitle(), and Title\newFromText().
Referenced by ApiUploadTest\testUpload(), ApiUploadTest\testUploadChunks(), ApiUploadTest\testUploadSameContent(), ApiUploadTest\testUploadSameFileName(), ApiUploadTest\testUploadStash(), and ApiUploadTest\testUploadZeroLength().
ApiTestCaseUpload::deleteFileByTitle | ( | $ | title | ) |
Helper function -- remove files and associated articles by Title.
$title | Title: title to be removed |
Definition at line 34 of file ApiTestCaseUpload.php.
References $comment, $file, $title, array(), FileDeleteForm\doDelete(), WikiPage\factory(), Title\newFromText(), and wfFindFile().
Referenced by deleteFileByContent(), and deleteFileByFileName().
ApiTestCaseUpload::fakeUploadChunk | ( | $ | fieldName, |
$ | fileName, | ||
$ | type, | ||
&$ | chunkData | ||
) |
Definition at line 112 of file ApiTestCaseUpload.php.
References $size, array(), and wfTempDir().
Referenced by ApiUploadTest\testUploadChunks().
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).
$fieldName | String: name this would have in the upload form |
$fileName | String: name to title this |
$type | String: mime type |
$filePath | String: path where to find file contents |
Definition at line 85 of file ApiTestCaseUpload.php.
References $size, array(), and wfTempDir().
Referenced by ApiUploadTest\testUpload(), ApiUploadTest\testUploadSameContent(), ApiUploadTest\testUploadSameFileName(), ApiUploadTest\testUploadStash(), and ApiUploadTest\testUploadZeroLength().
ApiTestCaseUpload::setUp | ( | ) | [protected] |
Fixture -- run before every test.
Reimplemented from ApiTestCase.
Definition at line 11 of file ApiTestCaseUpload.php.
References array(), clearFakeUploads(), MediaWikiTestCase\setMwGlobals(), and wfSetupSession().
ApiTestCaseUpload::tearDown | ( | ) | [protected] |
Reimplemented from MediaWikiTestCase.
Definition at line 24 of file ApiTestCaseUpload.php.
References clearTempUpload().