You are here

function menu_test_menu_name in Drupal 8

Same name and namespace in other branches
  1. 7 modules/simpletest/tests/menu_test.module \menu_test_menu_name()
  2. 9 core/modules/system/tests/modules/menu_test/menu_test.module \menu_test_menu_name()

Sets a static variable for the testMenuName() test.

Used to change the menu_name parameter of a menu.

Parameters

string $new_name: (optional) If set, will change the $menu_name value.

Return value

string The $menu_name value to use.

2 calls to menu_test_menu_name()
MenuRouterTest::doTestMenuName in core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
Tests for menu_name parameter for default menu links.
menu_test_menu_links_discovered_alter in core/modules/system/tests/modules/menu_test/menu_test.module
Implements hook_menu_links_discovered_alter().

File

core/modules/system/tests/modules/menu_test/menu_test.module, line 66
Module that implements various hooks for menu tests.

Code

function menu_test_menu_name($new_name = '') {
  static $menu_name = 'original';
  if ($new_name) {
    $menu_name = $new_name;
  }
  return $menu_name;
}