function FileFieldAnonymousSubmission::getTestImage

Generates a test image.

Return value

stdClass A file object.

2 calls to FileFieldAnonymousSubmission::getTestImage()
FileFieldAnonymousSubmission::testAnonymousNodeWithFile in modules/file/tests/file.test
Tests file submission for an anonymous visitor.
FileFieldAnonymousSubmission::_testNodeWithFileWithoutTitle in modules/file/tests/file.test
Helper method to test file submissions with missing node titles.

File

modules/file/tests/file.test, line 1936

Class

FileFieldAnonymousSubmission
Confirm that file field submissions work correctly for anonymous visitors.

Code

function getTestImage() {
    // Get a file to upload.
    $file = current($this->drupalGetTestFiles('image'));
    // Add a filesize property to files as would be read by file_load().
    $file->filesize = filesize($file->uri);
    return $file;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.