You are here

protected function FootermapBlockTest::getMenuParameters in footermap: a footer site map 8

Get the menu parameters to pass into menu tree parameters.

Parameters

int|bool $limit: (Optional) The recurse limit.

string|bool $menu: (Optional) The menu plugin id.

Return value

\Drupal\Core\Menu\MenuTreeParameters Menu tree parameter class.

File

tests/src/Unit/Plugin/Block/FootermapBlockTest.php, line 298

Class

FootermapBlockTest
Test footermap block methods.

Namespace

Drupal\Tests\footermap\Unit\Plugin\Block

Code

protected function getMenuParameters($limit = FALSE, $menu = FALSE) {
  $parameters = new MenuTreeParameters();
  $parameters
    ->onlyEnabledLinks();
  $parameters
    ->excludeRoot();
  if ($limit) {
    $parameters
      ->setMaxDepth($limit);
  }
  if ($menu) {
    $parameters
      ->setRoot($menu);
  }
  return $parameters;
}