function ModuleConfigureRouteTest::testModuleConfigureRoutes

Same name in other branches
  1. 8.9.x 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()
  3. 11.x core/tests/Drupal/KernelTests/Core/Extension/ModuleConfigureRouteTest.php \Drupal\KernelTests\Core\Extension\ModuleConfigureRouteTest::testModuleConfigureRoutes()

Tests if the module configure routes exists.

@dataProvider coreModuleListDataProvider

File

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

Class

ModuleConfigureRouteTest
Tests the configure route for core modules.

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testModuleConfigureRoutes(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 {$module_lifecycle}");
    }
    $this->container
        ->get('module_installer')
        ->install([
        $module_name,
    ]);
    $this->assertModuleConfigureRoutesExist($module_name, $module_info);
}

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