class LazyRouteProviderInstallTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php \Drupal\FunctionalTests\Routing\LazyRouteProviderInstallTest
- 10 core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php \Drupal\FunctionalTests\Routing\LazyRouteProviderInstallTest
- 8.9.x core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php \Drupal\FunctionalTests\Routing\LazyRouteProviderInstallTest
@group routing
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalTests\Routing\LazyRouteProviderInstallTest implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of LazyRouteProviderInstallTest
File
-
core/
tests/ Drupal/ FunctionalTests/ Routing/ LazyRouteProviderInstallTest.php, line 10
Namespace
Drupal\FunctionalTests\RoutingView source
class LazyRouteProviderInstallTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'lazy_route_provider_install_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests that the lazy route provider is used during a module install.
*/
public function testInstallation() {
$this->container
->get('module_installer')
->install([
'router_test',
]);
// Note that on DrupalCI the test site is installed in a sub directory so
// we cannot use ::assertEquals().
$this->assertStringEndsWith('/admin', \Drupal::state()->get('Drupal\\lazy_route_provider_install_test\\PluginManager'));
$this->assertStringEndsWith('/router_test/test1', \Drupal::state()->get('router_test_install'));
// If there is an exception thrown in rebuilding a route then the state
// 'lazy_route_provider_install_test_menu_links_discovered_alter' will be
// set.
// @see lazy_route_provider_install_test_menu_links_discovered_alter().
$this->assertEquals('success', \Drupal::state()->get('lazy_route_provider_install_test_menu_links_discovered_alter', NULL));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.