You are here

protected function MenuDependencyTest::setUp in Dependency Calculation 8

Overrides KernelTestBase::setUp

File

tests/src/Kernel/EventSubscriber/DependencyCollector/MenuDependencyTest.php, line 37

Class

MenuDependencyTest
Class MenuDependencyTest.

Namespace

Drupal\Tests\depcalc\Kernel\EventSubscriber\DependencyCollector

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('user');
  $this
    ->installEntitySchema('node');
  $this
    ->installEntitySchema('menu_link_content');
  $this
    ->installEntitySchema('path_alias');
  $this
    ->installSchema('system', [
    'sequences',
  ]);
  $user = \Drupal::entityTypeManager()
    ->getStorage('user')
    ->create([
    'uuid' => '3e346612-34c0-4d83-a6ef-e181fd562281',
    'name' => 'Test user',
  ]);
  $user
    ->save();
  $node = \Drupal::entityTypeManager()
    ->getStorage('node')
    ->create([
    'type' => 'article',
    'title' => 'A test article',
    'field_body' => 'body content',
    'uid' => 1,
  ]);
  $node
    ->save();
  $menu = \Drupal::entityTypeManager()
    ->getStorage('menu')
    ->create([
    'id' => 'test',
    'label' => 'Test Menu',
    'uuid' => '38584be3-605a-47b1-8881-838e1424d0f9',
  ]);
  $menu
    ->save();
}