function FileFieldTestCase::getTestFile in Drupal 7
Retrieves a sample file of the specified type.
17 calls to FileFieldTestCase::getTestFile()
- FileFieldDisplayTestCase::testDefaultFileFieldDisplay in modules/
file/ tests/ file.test - Tests default display of File Field.
- FileFieldDisplayTestCase::testNodeDisplay in modules/
file/ tests/ file.test - Tests normal formatter display on node display.
- FileFieldPathTestCase::testUploadPath in modules/
file/ tests/ file.test - Tests the normal formatter display on node display.
- FileFieldRevisionTestCase::testRevisions in modules/
file/ tests/ file.test - Tests creating multiple revisions of a node and managing attached files.
- FileFieldValidateTestCase::testFileExtension in modules/
file/ tests/ file.test - Tests file extension checking.
File
- modules/
file/ tests/ file.test, line 32 - Tests for file.module.
Class
- FileFieldTestCase
- Provides methods specifically for testing File module's field handling.
Code
function getTestFile($type_name, $size = NULL) {
// Get a file to upload.
$file = current($this
->drupalGetTestFiles($type_name, $size));
// Add a filesize property to files as would be read by file_load().
$file->filesize = filesize($file->uri);
return $file;
}