You are here

protected function AttachmentNormalizerTest::setUp in Replication 8

Overrides NormalizerTestBase::setUp

File

tests/src/Kernel/Normalizer/AttachmentNormalizerTest.php, line 40

Class

AttachmentNormalizerTest
Tests the attachment serialization format.

Namespace

Drupal\Tests\replication\Kernel\Normalizer

Code

protected function setUp() {
  parent::setUp();
  $this->fileContents = $this
    ->randomString();
  $this->fileHandle = fopen('temporary://' . $this
    ->randomMachineName(), 'w+b');
  fwrite($this->fileHandle, $this->fileContents);
  rewind($this->fileHandle);
  $meta = stream_get_meta_data($this->fileHandle);
  $this->fileEntity = File::create([
    'uri' => $meta['uri'],
  ]);
}