You are here

function menu_test_menu in SimpleTest 7

Implement hook_menu().

File

tests/menu_test.module, line 11
Dummy module implementing hook menu.

Code

function menu_test_menu() {

  // The name of the menu changes during the course of the test. Using a $_GET.
  $items['menu_name_test'] = array(
    'title' => 'Test menu_name router item',
    'page callback' => 'node_save',
    'menu_name' => menu_test_menu_name(),
  );

  // Use FALSE as 'title callback' to bypass t().
  $items['menu_no_title_callback'] = array(
    'title' => 'A title with @placeholder',
    'title callback' => FALSE,
    'title arguments' => array(
      '@placeholder' => 'some other text',
    ),
    'page callback' => 'menu_test_callback',
    'access arguments' => array(
      'access content',
    ),
  );

  // Hidden link for menu_link_maintain tests
  $items['menu_test_maintain/%'] = array(
    'title' => 'Menu maintain test',
    'page callback' => 'node_page_default',
    'access arguments' => array(
      'access content',
    ),
  );

  // Hierarchical tests.
  $items['menu-test/hierarchy/parent'] = array(
    'title' => 'Parent menu router',
    'page callback' => 'node_page_default',
  );
  $items['menu-test/hierarchy/parent/child'] = array(
    'title' => 'Child menu router',
    'page callback' => 'node_page_default',
  );
  $items['menu-test/hierarchy/parent/child2/child'] = array(
    'title' => 'Unattached subchild router',
    'page callback' => 'node_page_default',
  );

  // Theme callback tests.
  $items['menu-test/theme-callback/%'] = array(
    'title' => 'Page that displays different themes',
    'page callback' => 'menu_test_theme_page_callback',
    'access arguments' => array(
      'access content',
    ),
    'theme callback' => 'menu_test_theme_callback',
    'theme arguments' => array(
      2,
    ),
  );
  $items['menu-test/theme-callback/%/inheritance'] = array(
    'title' => 'Page that tests theme callback inheritance.',
    'page callback' => 'menu_test_theme_page_callback',
    'page arguments' => array(
      TRUE,
    ),
    'access arguments' => array(
      'access content',
    ),
  );
  return $items;
}