You are here

function FileEntityTestBase::getTestFile in File Entity (fieldable files) 8.2

Retrieves a sample file of the specified type.

5 calls to FileEntityTestBase::getTestFile()
FileEntityCreationTest::testFileEntityCreationMultipleSteps in tests/src/Functional/FileEntityCreationTest.php
Upload a file with both private and public folder set.
FileEntityCreationTest::testImageAltTitleFields in tests/src/Functional/FileEntityCreationTest.php
Test the Title Text and Alt Text fields of to the predefined Image type.
FileEntityCreationTest::testSingleFileEntityCreation in tests/src/Functional/FileEntityCreationTest.php
Create a "document" file and verify its consistency in the database.
FileEntityEditTest::testFileEntityAssociatedUser in tests/src/Functional/FileEntityEditTest.php
Check changing file associated user fields.
FileEntityEditTest::testFileEntityEdit in tests/src/Functional/FileEntityEditTest.php
Check file edit functionality.

File

tests/src/Functional/FileEntityTestBase.php, line 144

Class

FileEntityTestBase
Base class for file entity tests.

Namespace

Drupal\Tests\file_entity\Functional

Code

function getTestFile($type_name, $size = NULL) {

  // Get a file to upload.
  $file = current($this
    ->getTestFiles($type_name, $size));

  // Add a filesize property to files as would be read by file_load().
  $file->filesize = filesize($file->uri);
  return $file;
}