You are here

protected function AliasLinkEnhancerTest::setUp in Gatsby Live Preview & Incremental Builds 8

Same name and namespace in other branches
  1. 2.0.x modules/gatsby_extras/tests/src/Kernel/AliasLinkEnhancerTest.php \Drupal\Tests\gatsby_extras\Kernel\AliasLinkEnhancerTest::setUp()

Overrides KernelTestBase::setUp

File

modules/gatsby_extras/tests/src/Kernel/AliasLinkEnhancerTest.php, line 60

Class

AliasLinkEnhancerTest
Defines a test for AliasLinkEnhancer.

Namespace

Drupal\Tests\gatsby_extras\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installEntitySchema('path_alias');
  $this
    ->installEntitySchema('taxonomy_term');
  $this->enhancer = $this->container
    ->get('plugin.manager.resource_field_enhancer')
    ->createInstance('alias_link');
  $vocabulary = $this
    ->createVocabulary();
  $this->term = $this
    ->createTerm($vocabulary);
  $this->pathAlias = $this
    ->createPathAlias($this->term
    ->toUrl()
    ->toString(), $this
    ->randomMachineName());
  $this->container
    ->get('path_processor_manager')
    ->addOutbound($this->container
    ->get('path_alias.path_processor'));
}