You are here

public function MenuTest::testMenuLinks in GraphQL 8.4

@covers \Drupal\graphql\Plugin\GraphQL\DataProducer\Menu\MenuLinks::resolve

File

tests/src/Kernel/DataProducer/MenuTest.php, line 101

Class

MenuTest
Data producers Menu test class.

Namespace

Drupal\Tests\graphql\Kernel\DataProducer

Code

public function testMenuLinks() : void {
  $result = $this
    ->executeDataProducer('menu_links', [
    'menu' => $this->menu,
  ]);
  $count = 0;
  foreach ($result as $link_tree) {
    $this
      ->assertInstanceOf(MenuLinkTreeElement::class, $link_tree);
    $count += $link_tree
      ->count();
  }
  $this
    ->assertEquals(5, $count);
}