You are here

protected function FileTest::generateBigFile in Entity Share 8.2

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

Helper function.

Parameters

string $file_uuid: The file UUID.

array $file_data: The file data as in static::filesData.

File

modules/entity_share_client/tests/src/Functional/FileTest.php, line 329

Class

FileTest
Functional test class for file field.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

protected function generateBigFile($file_uuid, array $file_data) {

  // 100 MB.
  $size = 100000000;
  $file_pointer = fopen($file_data['uri'], 'w');
  fseek($file_pointer, $size - 1, SEEK_CUR);
  fwrite($file_pointer, 'a');
  fclose($file_pointer);
  $this->filesSize[$file_uuid] = filesize($file_data['uri']);
}