Mercurial > hg > isophonics-drupal-site
comparison core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
11:bfffd8d7479a | 12:7a779792577d |
---|---|
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 } |