You are here

function MediaBulkUploadTestHelper::getTestFile in D7 Media 7.2

Same name and namespace in other branches
  1. 7.4 modules/media_bulk_upload/tests/media_bulk_upload.test \MediaBulkUploadTestHelper::getTestFile()
  2. 7.3 modules/media_bulk_upload/tests/media_bulk_upload.test \MediaBulkUploadTestHelper::getTestFile()

Retrieves a sample file of the specified type.

1 call to MediaBulkUploadTestHelper::getTestFile()
MediaBulkUploadEditTestCase::testBulkFileEditing in modules/media_bulk_upload/tests/media_bulk_upload.test
Tests editing with multiple files.

File

modules/media_bulk_upload/tests/media_bulk_upload.test, line 27
Tests for media_bulk_upload.module.

Class

MediaBulkUploadTestHelper
Provides methods specifically for testing Media Bulk Upload module's bulk file uploading capabilities.

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;
}