You are here

protected function BasicCreationTest::setUp in Media entity 8

Overrides KernelTestBase::setUp

File

tests/src/Kernel/BasicCreationTest.php, line 42

Class

BasicCreationTest
Tests creation of Media Bundles and Media Entities.

Namespace

Drupal\Tests\media_entity\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('user');
  $this
    ->installEntitySchema('file');
  $this
    ->installSchema('file', 'file_usage');
  $this
    ->installEntitySchema('media');
  $this
    ->installConfig([
    'field',
    'system',
    'image',
    'file',
  ]);

  // Create a test bundle.
  $id = strtolower($this
    ->randomMachineName());
  $this->testBundle = MediaBundle::create([
    'id' => $id,
    'label' => $id,
    'type' => 'generic',
    'type_configuration' => [],
    'field_map' => [],
    'new_revision' => FALSE,
  ]);
  $this->testBundle
    ->save();
}