lazy_route_provider_install_test.module

Same filename and directory in other branches
  1. 8.9.x core/modules/system/tests/modules/lazy_route_provider_install_test/lazy_route_provider_install_test.module
  2. 10 core/modules/system/tests/modules/lazy_route_provider_install_test/lazy_route_provider_install_test.module
  3. 11.x core/modules/system/tests/modules/lazy_route_provider_install_test/lazy_route_provider_install_test.module

Helper module for the lazy route provider tests.

File

core/modules/system/tests/modules/lazy_route_provider_install_test/lazy_route_provider_install_test.module

View source
<?php


/**
 * @file
 * Helper module for the lazy route provider tests.
 */


/**
 * Implements hook_menu_links_discovered_alter().
 */
function lazy_route_provider_install_test_menu_links_discovered_alter(&$links) {
  $message = \Drupal::state()->get(__FUNCTION__, 'success');
  try {
    // Ensure that calling this does not cause a recursive rebuild.
    \Drupal::service('router.route_provider')->getAllRoutes();
  } catch (\RuntimeException $e) {
    $message = 'failed';
  }
  \Drupal::state()->set(__FUNCTION__, $message);
}

Functions

Title Deprecated Summary
lazy_route_provider_install_test_menu_links_discovered_alter Implements hook_menu_links_discovered_alter().

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.