You are here

function FileFieldTestCase::getTestFile in FileField 6.3

Get a sample file of the specified type.

7 calls to FileFieldTestCase::getTestFile()
FileFieldDisplayTestCase::testNodeDisplay in tests/filefield.test
Test normal formatter display on node display.
FileFieldPathTestCase::testUploadPath in tests/filefield.test
Test normal formatter display on node display.
FileFieldRevisionTestCase::testRevisions in tests/filefield.test
Test creating multiple revisions of a node and managing the attached files.
FileFieldValidateTestCase::testFileExtension in tests/filefield.test
Test the file extension, do additional checks if mimedetect is installed.
FileFieldValidateTestCase::testFileMaxSize in tests/filefield.test
Test the max file size validator.

... See full list

File

tests/filefield.test, line 23

Class

FileFieldTestCase

Code

function getTestFile($type, $size = NULL) {

  // Get a file to upload.
  $file = current($this
    ->drupalGetTestFiles($type, $size));

  // SimpleTest files incorrectly use "filename" instead of "filepath".
  $file->filepath = $file->filename;
  $file->filename = basename($file->filepath);
  $file->filesize = filesize($file->filepath);
  return $file;
}