You are here

public function SubstitutionPluginTest::setUp in Linkit 8.5

Overrides LinkitKernelTestBase::setUp

File

tests/src/Kernel/SubstitutionPluginTest.php, line 53

Class

SubstitutionPluginTest
Tests the substitution plugins.

Namespace

Drupal\Tests\linkit\Kernel

Code

public function setUp() {
  parent::setUp();
  $this->substitutionManager = $this->container
    ->get('plugin.manager.linkit.substitution');
  $this->entityTypeManager = $this->container
    ->get('entity_type.manager');
  $this
    ->installEntitySchema('file');
  $this
    ->installEntitySchema('entity_test');
  $this
    ->installEntitySchema('media');
  $this
    ->installEntitySchema('media_type');
  $this
    ->installEntitySchema('field_storage_config');
  $this
    ->installEntitySchema('field_config');
  $this
    ->installSchema('file', [
    'file_usage',
  ]);
  $this
    ->installConfig([
    'media',
  ]);
  \Drupal::entityTypeManager()
    ->clearCachedDefinitions();
  unset($GLOBALS['config']['system.file']);
  \Drupal::configFactory()
    ->getEditable('system.file')
    ->set('default_scheme', 'public')
    ->save();
}