You are here

public function ModuleConfigureRouteTest::testDeprecatedModuleConfigureRoutes in Drupal 10

Tests if the module with lifecycle deprecated configure routes exists.

Note: This test is part of group legacy, to make sure installing the deprecated module doesn't trigger a deprecation notice.

@group legacy

@dataProvider coreModuleListDataProvider

File

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

Class

ModuleConfigureRouteTest
Tests the configure route for core modules.

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testDeprecatedModuleConfigureRoutes(string $module_name) : void {
  $module_info = $this->moduleInfo[$module_name]->info;
  if (!isset($module_info['configure'])) {
    $this
      ->markTestSkipped("{$module_name} has no configure route");
  }
  $module_lifecycle = $module_info[ExtensionLifecycle::LIFECYCLE_IDENTIFIER];
  if (isset($module_lifecycle) && $module_lifecycle !== ExtensionLifecycle::DEPRECATED) {
    $this
      ->markTestSkipped("{$module_name} is not {$module_lifecycle}");
  }
  $this->container
    ->get('module_installer')
    ->install([
    $module_name,
  ]);
  $this
    ->assertModuleConfigureRoutesExist($module_name, $module_info);
}