You are here

protected function MenuTest::setUp in GraphQL 8.3

Overrides GraphQLCoreTestBase::setUp

File

modules/graphql_core/tests/src/Kernel/Menu/MenuTest.php, line 29

Class

MenuTest
Test access to menu items.

Namespace

Drupal\Tests\graphql_core\Kernel\Menu

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('menu_link_content');
  $this
    ->installConfig('menu_link_content');
  $this
    ->installConfig('graphql_test_menu');
  $externalLink = MenuLinkContent::create([
    'title' => 'Drupal',
    'link' => [
      'uri' => 'http://www.drupal.org',
    ],
    'menu_name' => 'test',
    'external' => 1,
    'enabled' => 1,
    'weight' => 5,
  ]);
  $externalLink
    ->save();

  /** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menuLinkManager */
  $menuLinkManager = $this->container
    ->get('plugin.manager.menu.link');
  $menuLinkManager
    ->rebuild();
}