You are here

protected function EntityPathAliasCollectorTest::setUp in Dependency Calculation 8

Overrides KernelTestBase::setUp

1 call to EntityPathAliasCollectorTest::setUp()
PathAliasEntityCollectorTest::setUp in tests/src/Kernel/EventSubscriber/DependencyCollector/PathAliasEntityCollectorTest.php
1 method overrides EntityPathAliasCollectorTest::setUp()
PathAliasEntityCollectorTest::setUp in tests/src/Kernel/EventSubscriber/DependencyCollector/PathAliasEntityCollectorTest.php

File

tests/src/Kernel/EventSubscriber/DependencyCollector/EntityPathAliasCollectorTest.php, line 70

Class

EntityPathAliasCollectorTest
Test node with path alias dependency collector.

Namespace

Drupal\Tests\depcalc\Kernel\EventSubscriber\DependencyCollector

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installConfig([
    'node',
    'field',
    'filter',
  ]);
  $this
    ->installEntitySchema('node');
  $this
    ->installEntitySchema('path_alias');
  $this
    ->installEntitySchema('user');

  // Create a test content type.
  $this
    ->createContentType();

  // Create a test node.
  $this->node = $this
    ->createNode();

  // Creates a new path alias.
  $this->alias = $this
    ->createPathAlias("/node/{$this->node->id()}", "/test-alias");
  $this->calculator = \Drupal::service('entity.dependency.calculator');
}