comparison core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c75dbcec494b
1 <?php
2
3 namespace Drupal\FunctionalTests\Routing;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8 * @group routing
9 */
10 class LazyRouteProviderInstallTest extends BrowserTestBase {
11
12 /**
13 * {@inheritdoc}
14 */
15 protected static $modules = ['lazy_route_provider_install_test'];
16
17 /**
18 * Tests that the lazy route provider is used during a module install.
19 */
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
28 // set.
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));
31 }
32
33 }