function MediaLibraryTestHelper::getTestFile in Media Library 7
Retrieves a sample file of the specified type.
1 call to MediaLibraryTestHelper::getTestFile()
- MediaLibraryUploadWizardTestCase::testMediaLibraryUploadWizardCheckbox in ./
media_library.test - Test the file upload wizard 'add to library' checkbox.
File
- ./
media_library.test, line 21 - Test integration for the Media Library module.
Class
- MediaLibraryTestHelper
- @file Test integration for the Media Library module.
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;
}