You are here

protected function DropzoneJsUploadControllerTest::setUp in DropzoneJS 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/DropzoneJsUploadControllerTest.php \Drupal\Tests\dropzonejs\Kernel\DropzoneJsUploadControllerTest::setUp()

Overrides KernelTestBase::setUp

File

tests/src/Kernel/DropzoneJsUploadControllerTest.php, line 58

Class

DropzoneJsUploadControllerTest
Tests dropzoneJs upload controller.

Namespace

Drupal\Tests\dropzonejs\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installSchema('system', 'router');
  $this
    ->installConfig('dropzonejs');
  $this
    ->installEntitySchema('user');
  $this->filesDir = $this->siteDirectory . '/files';
  $config = $this->container
    ->get('config.factory');
  $config
    ->getEditable('system.file')
    ->set('path.temporary', $this->filesDir)
    ->save();
  $this->tmpFile = tempnam('', $this->testfilePrefix);
  file_put_contents($this->tmpFile, $this->testfileData);
}