protected function FileDownloadUrlTest::setUp in JSON:API 8
Overrides KernelTestBase::setUp
File
- tests/
src/ Kernel/ Field/ FileDownloadUrlTest.php, line 45
Class
- FileDownloadUrlTest
- @coversDefaultClass \Drupal\jsonapi\Field\FileDownloadUrl @group jsonapi @group legacy
Namespace
Drupal\Tests\jsonapi\Kernel\FieldCode
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('file');
$this
->installSchema('file', [
'file_usage',
]);
// Create a new file entity.
$this->file = File::create([
'filename' => $this->filename,
'uri' => sprintf('public://%s', $this->filename),
'filemime' => 'text/plain',
'status' => FILE_STATUS_PERMANENT,
]);
$this->file
->save();
}