You are here

public function ModuleConfigureRouteTest::testModuleConfigureRoutes in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Extension/ModuleConfigureRouteTest.php \Drupal\KernelTests\Core\Extension\ModuleConfigureRouteTest::testModuleConfigureRoutes()
  2. 10 core/tests/Drupal/KernelTests/Core/Extension/ModuleConfigureRouteTest.php \Drupal\KernelTests\Core\Extension\ModuleConfigureRouteTest::testModuleConfigureRoutes()

Tests the module configure routes exist.

@dataProvider coreModuleListDataProvider

File

core/tests/Drupal/KernelTests/Core/Extension/ModuleConfigureRouteTest.php, line 49

Class

ModuleConfigureRouteTest
Tests the configure route for core modules.

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testModuleConfigureRoutes($module) {
  $module_info = $this->moduleInfo[$module]->info;
  if (!isset($module_info['configure'])) {
    $this
      ->markTestSkipped("{$module} has no configure route");
  }
  $this->container
    ->get('module_installer')
    ->install([
    $module,
  ]);
  $route = $this->routeProvider
    ->getRouteByName($module_info['configure']);
  $this
    ->assertNotEmpty($route, sprintf('The configure route for the "%s" module was found.', $module));
}