function MediaInternetTestHelper::getTestFile in D7 Media 7.3
Same name and namespace in other branches
- 7.4 modules/media_internet/tests/media_internet.test \MediaInternetTestHelper::getTestFile()
- 7.2 modules/media_internet/tests/media_internet.test \MediaInternetTestHelper::getTestFile()
Retrieves a sample file of the specified type.
File
- modules/
media_internet/ tests/ media_internet.test, line 27 - Tests for media_internet.module.
Class
- MediaInternetTestHelper
- Provides methods specifically for testing Media Internet module's remote media 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;
}