private function RouterTest::hookMenu in Drupal 7 to 8/9 Module Upgrader 8
The Diff module's hook_menu() implementation. It's a nice mix of things to test on.
Return value
array
1 call to RouterTest::hookMenu()
- RouterTest::setUp in tests/
src/ Unit/ Routing/ Drupal7/ RouterTest.php
File
- tests/
src/ Unit/ Routing/ Drupal7/ RouterTest.php, line 81
Class
- RouterTest
- @group DMU.Routing
Namespace
Drupal\Tests\drupalmoduleupgrader\Unit\Routing\Drupal7Code
private function hookMenu() {
$items = [];
$items['node/%node/revisions/list'] = [
'title' => 'List revisions',
'page callback' => 'diff_diffs_overview',
'type' => 'MENU_DEFAULT_LOCAL_TASK',
'access callback' => 'diff_node_revision_access',
'access arguments' => [
1,
],
'file' => 'diff.pages.inc',
];
$items['node/%node/revisions/view'] = [
'title' => 'Compare revisions',
'page callback' => 'diff_diffs_show',
'page arguments' => [
1,
4,
5,
6,
],
'type' => 'MENU_LOCAL_TASK',
'access callback' => 'diff_node_revision_access',
'access arguments' => [
1,
],
'tab_parent' => 'node/%/revisions/list',
'file' => 'diff.pages.inc',
];
$items['node/%node/revisions/view/latest'] = [
'title' => 'Show latest difference',
'page callback' => 'diff_latest',
'page arguments' => [
1,
],
'type' => 'MENU_LOCAL_TASK',
'access arguments' => [
'access content',
],
'tab_parent' => 'node/%/revisions/view',
'file' => 'diff.pages.inc',
];
$items['admin/config/content/diff'] = [
'title' => 'Diff',
'description' => 'Diff settings.',
'file' => 'diff.admin.inc',
'page callback' => 'drupal_get_form',
'page arguments' => [
'diff_admin_settings',
],
'access arguments' => [
'administer site configuration',
],
];
$items['admin/config/content/diff/settings'] = [
'title' => 'Settings',
'type' => 'MENU_DEFAULT_LOCAL_TASK',
'weight' => -10,
];
$items['admin/config/content/diff/fields'] = [
'title' => 'Fields',
'description' => 'Field support and settings overview.',
'file' => 'diff.admin.inc',
'page callback' => 'diff_admin_field_overview',
'access arguments' => [
'administer site configuration',
],
'type' => 'MENU_LOCAL_TASK',
];
$items['admin/config/content/diff/fields/%'] = [
'title' => 'Global field settings',
'page callback' => 'drupal_get_form',
'page arguments' => [
'diff_admin_global_field_settings',
5,
],
'access arguments' => [
'administer site configuration',
],
'type' => 'MENU_VISIBLE_IN_BREADCRUMB',
'file' => 'diff.admin.inc',
];
$items['admin/config/content/diff/entities'] = [
'title' => 'Entities',
'description' => 'Entity settings.',
'file' => 'diff.admin.inc',
'page callback' => 'drupal_get_form',
'page arguments' => [
'diff_admin_global_entity_settings',
'node',
],
'access arguments' => [
'administer site configuration',
],
'type' => 'MENU_LOCAL_TASK',
];
$items['admin/config/content/diff/entities/node'] = [
'title' => 'Nodes',
'description' => 'Node comparison settings.',
'type' => 'MENU_DEFAULT_LOCAL_TASK',
'weight' => -10,
];
$items['admin/config/content/diff/entities/user'] = [
'title' => 'Users',
'description' => 'User diff settings.',
'file' => 'diff.admin.inc',
'page callback' => 'drupal_get_form',
'page arguments' => [
'diff_admin_global_entity_settings',
'user',
],
'access arguments' => [
'administer site configuration',
],
'type' => 'MENU_LOCAL_TASK',
];
return $items;
}