You are here

protected function ImageFieldTokensTestCase::getTestFile in ImageField Tokens 7

Retrieves a sample file of the specified type.

1 call to ImageFieldTokensTestCase::getTestFile()
ImageFieldTokensTestCase::testUploadImage in tests/imagefield_tokens.test
Test image uploading.

File

tests/imagefield_tokens.test, line 126
This file implements tests for ImageFiled Tokens.

Class

ImageFieldTokensTestCase
Class ImageFieldTokensTestCase.

Code

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