diff --git a/core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php b/core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php index ade379a425..cac59a7324 100644 --- a/core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php +++ b/core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php @@ -32,7 +32,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac // Generate a URL during construction to prove that URL generation works. If // the route was missing an exception would be thrown. This also forces the // route provider to be initialized very early during a module install. - Url::fromRoute('system.admin')->toString(); + \Drupal::state()->set(__CLASS__, Url::fromRoute('system.admin')->toString()); parent::__construct('Plugin/LazyRouteProviderInstallTest', $namespaces, $module_handler, NULL, PluginID::class); } diff --git a/core/modules/system/tests/modules/router_test_directory/router_test.install b/core/modules/system/tests/modules/router_test_directory/router_test.install index 9c433c6769..7c718fa131 100644 --- a/core/modules/system/tests/modules/router_test_directory/router_test.install +++ b/core/modules/system/tests/modules/router_test_directory/router_test.install @@ -13,5 +13,5 @@ function router_test_install() { // Ensure a URL can be generated for routes provided by the module during // installation. - Url::fromRoute('router_test.1')->toString(); + \Drupal::state()->set(__FUNCTION__, Url::fromRoute('router_test.1')->toString()); } diff --git a/core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php b/core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php index 1ce116953d..52d7341df6 100644 --- a/core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php +++ b/core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php @@ -19,6 +19,8 @@ class LazyRouteProviderInstallTest extends BrowserTestBase { */ public function testInstallation() { $this->container->get('module_installer')->install(['router_test']); + $this->assertEquals('/admin', \Drupal::state()->get('Drupal\lazy_route_provider_install_test\PluginManager')); + $this->assertEquals('/router_test/test1', \Drupal::state()->get('router_test_install')); } }