You are here

protected function AttachmentNormalizerTest::setUp in Replication 8.2

Overrides NormalizerTestBase::setUp

File

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

Class

AttachmentNormalizerTest
Tests the attachment serialization format.

Namespace

Drupal\Tests\replication\Unit\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'],
  ]);
}