protected function FileTest::generateBigFile in Entity Share 8.3
Same name and namespace in other branches
- 8.2 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 403
Class
- FileTest
- Functional test class for file field.
Namespace
Drupal\Tests\entity_share_client\FunctionalCode
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']);
}