src/DrupalExtension/Context/MenuContext.php
public function assertMenuStructureForContent($menu_name, TableNode $table) {
    $menu_items = $table->getColumnsHash();
    foreach ($menu_items as $key => $menu_item) {
      $node = $this->getCore()->loadNodeByName($menu_item['title']);
      $menu_items[$key]['uri'] = "entity:node/{$this->getCore()->getNodeId($node)}";
    }

    try {
      $this->menuLinks = array_merge($this->menuLinks, $this->getCore()->createMenuStructure($menu_name, $menu_items));
    }
    catch (\InvalidArgumentException $e) {
      throw new ExpectationException($e->getMessage(), $this->getSession());
    }
  }
public function assertMenuStructureForContent($menu_name, TableNode $table) {
    $menu_items = $table->getColumnsHash();
    foreach ($menu_items as $key => $menu_item) {
      $node = $this->getCore()->loadNodeByName($menu_item['title']);
      $menu_items[$key]['uri'] = "entity:node/{$this->getCore()->getNodeId($node)}";
    }

    try {
      $this->menuLinks = array_merge($this->menuLinks, $this->getCore()->createMenuStructure($menu_name, $menu_items));
    }
    catch (\InvalidArgumentException $e) {
      throw new ExpectationException($e->getMessage(), $this->getSession());
    }
  }
public function assertMenuStructureForContent ( $ menu_name , TableNode $ table ) { $ menu_items = $ table -> getColumnsHash ( ) ; foreach ( $ menu_items as $ key => $ menu_item ) { $ node = $ this -> getCore ( ) -> loadNodeByName ( $ menu_item [ 'title' ] ) ; $ menu_items [ $ key ] [ 'uri' ] = "entity:node/{$this->getCore()->getNodeId($node)}" ; } try { $ this -> menuLinks = array_merge ( $ this -> menuLinks , $ this -> getCore ( ) -> createMenuStructure ( $ menu_name , $ menu_items ) ) ; } catch ( \ InvalidArgumentException $ e ) { throw new ExpectationException ( $ e -> getMessage ( ) , $ this -> getSession ( ) ) ; } }
Create menu structure for nodes.

@param string $menu_name
Menu machine name.
@param \Behat\Gherkin\Node\TableNode $table
Table representing the menu structure to be specified as follows:
| title  | parent |
| Page 1 |        |
| Page 2 | Page 1 |
| Page 3 | Page 2 |.

@throws \Behat\Mink\Exception\ExpectationException
Throws exception if menu not found.

@Given the following :menu_name menu structure for content:
Create menu structure for nodes .