You are here

function FileEntityTestHelper::getTestFile in File Entity (fieldable files) 7.3

Same name and namespace in other branches
  1. 7.2 file_entity.test \FileEntityTestHelper::getTestFile()

Retrieves a sample file of the specified type.

11 calls to FileEntityTestHelper::getTestFile()
FileEntityAltTitleTestCase::testFileEntityAltTitle in ./file_entity.test
Create an "image" file and verify its associated alt and title text.
FileEntityEditTestCase::testFileEntityAssociatedUser in ./file_entity.test
Check changing file associated user fields.
FileEntityEditTestCase::testFileEntityEdit in ./file_entity.test
Check file edit functionality.
FileEntityReplaceTestCase::testReplaceFile in ./file_entity.test
@todo Test image dimensions for an image field are reset when a file is replaced. @todo Test image styles are cleared when an image is updated.
FileEntityUnitTestCase::testFileEntity in ./file_entity.test
Tests basic file entity properties.

... See full list

File

./file_entity.test, line 21
Test integration for the file_entity module.

Class

FileEntityTestHelper
@file Test integration for the file_entity 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;
}