You are here

protected function FileDeletedTest::postSetupFixture in Entity Share 8.2

Same name and namespace in other branches
  1. 8.3 modules/entity_share_client/tests/src/Functional/FileDeletedTest.php \Drupal\Tests\entity_share_client\Functional\FileDeletedTest::postSetupFixture()

Helper function.

Need to separate those steps from the setup in the base class, because some sub-class setup may change the content of the fixture.

Overrides FileTest::postSetupFixture

File

modules/entity_share_client/tests/src/Functional/FileDeletedTest.php, line 32

Class

FileDeletedTest
Test class for file field where the physical file had been deleted.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

protected function postSetupFixture() {
  $this
    ->prepareContent();

  // Delete the physical file before populating the request service.

  /** @var \Drupal\Core\File\FileSystemInterface $file_system */
  $file_system = \Drupal::service('file_system');
  foreach (static::$filesData as $file_data) {
    $file_system
      ->delete($file_data['uri']);
  }
  $this
    ->populateRequestService();
  $this
    ->deleteContent();
}