installSchema('system', 'router'); \Drupal::service('router.builder')->rebuild(); } public function testIntegration() { /** @var \Drupal\Core\Menu\LocalTaskManagerInterface $local_tasks_manager */ $local_tasks_manager = \Drupal::service('plugin.manager.menu.local_task'); $tasks = $local_tasks_manager->getDefinitions(); $this->assertArrayHasKey('entity.revisions_overview:entity_test_enhanced', $tasks); $this->assertArrayNotHasKey('entity.revisions_overview:node', $tasks, 'Node should have been excluded because it provides their own'); $this->assertEquals('entity.entity_test_enhanced.version_history', $tasks['entity.revisions_overview:entity_test_enhanced']['route_name']); $this->assertEquals('entity.entity_test_enhanced.canonical', $tasks['entity.revisions_overview:entity_test_enhanced']['base_route']); /** @var \Drupal\Core\Routing\RouteProviderInterface $route_provider */ $route_provider = \Drupal::service('router.route_provider'); $route = $route_provider->getRouteByName('entity.entity_test_enhanced.version_history'); $this->assertInstanceOf(Route::class, $route); $this->assertEquals('\Drupal\entity\Controller\RevisionOverviewController::revisionOverviewController', $route->getDefault('_controller')); } }