You are here

protected function WebformElementManagedFileTestBase::fileLoad in Webform 6.x

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/Element/WebformElementManagedFileTestBase.php \Drupal\Tests\webform\Functional\Element\WebformElementManagedFileTestBase::fileLoad()

Load an uncached file entity.

Parameters

string $fid: A file id.

Return value

\Drupal\file\FileInterface An uncached file object

1 call to WebformElementManagedFileTestBase::fileLoad()
WebformElementManagedFileTest::testFileManagement in tests/src/Functional/Element/WebformElementManagedFileTest.php
Test file management.

File

tests/src/Functional/Element/WebformElementManagedFileTestBase.php, line 64

Class

WebformElementManagedFileTestBase
Base class for testing webform element managed file handling.

Namespace

Drupal\Tests\webform\Functional\Element

Code

protected function fileLoad($fid) {
  \Drupal::entityTypeManager()
    ->getStorage('file')
    ->resetCache();
  return File::load($fid);
}