3 namespace Drupal\FunctionalTests\Routing;
5 use Drupal\Tests\BrowserTestBase;
10 class LazyRouteProviderInstallTest extends BrowserTestBase {
15 protected static $modules = ['lazy_route_provider_install_test'];
18 * Tests that the lazy route provider is used during a module install.
20 public function testInstallation() {
21 $this->container->get('module_installer')->install(['router_test']);
22 // Note that on DrupalCI the test site is installed in a sub directory so
23 // we cannot use ::assertEquals().
24 $this->assertStringEndsWith('/admin', \Drupal::state()->get('Drupal\lazy_route_provider_install_test\PluginManager'));
25 $this->assertStringEndsWith('/router_test/test1', \Drupal::state()->get('router_test_install'));
26 // If there is an exception thrown in rebuilding a route then the state
27 // 'lazy_route_provider_install_test_menu_links_discovered_alter' will be
29 // @see lazy_route_provider_install_test_menu_links_discovered_alter().
30 $this->assertEquals('success', \Drupal::state()->get('lazy_route_provider_install_test_menu_links_discovered_alter', NULL));