You are here

protected function PathautoEntityWithStringIdTest::setUp in Pathauto 8

Overrides KernelTestBase::setUp

File

tests/src/Kernel/PathautoEntityWithStringIdTest.php, line 62

Class

PathautoEntityWithStringIdTest
Tests auto-aliasing of entities that use string IDs.

Namespace

Drupal\Tests\pathauto\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installSchema('system', [
    'key_value',
  ]);
  $this
    ->installConfig([
    'system',
    'pathauto',
  ]);
  if ($this->container
    ->get('entity_type.manager')
    ->hasDefinition('path_alias')) {
    $this
      ->installEntitySchema('path_alias');
  }
  $this
    ->installEntitySchema('pathauto_string_id_test');
  $this
    ->createPattern('pathauto_string_id_test', '/[pathauto_string_id_test:name]');

  /** @var \Drupal\pathauto\AliasTypeManager $alias_type_manager */
  $alias_type_manager = $this->container
    ->get('plugin.manager.alias_type');
  $this->aliasType = $alias_type_manager
    ->createInstance('canonical_entities:pathauto_string_id_test');
}