diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php index 1cd383e..b32c724 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php @@ -8,6 +8,7 @@ namespace Drupal\system\Tests\Routing; use Drupal\simpletest\WebTestBase; +use Symfony\Component\Routing\RequestContext; /** * Functional class for the full integrated routing system. @@ -143,6 +144,18 @@ public function testControllerResolutionPage() { } /** + * Checks the generate method on the url generator using the front router. + */ + public function testUrlGeneratorFront() { + $context = new RequestContext(); + $context->fromRequest($this->container->get('request')); + $this->container->get('url_generator')->setContext($context); + + $this->assertEqual($this->container->get('url_generator')->generate('front'), $context->getBaseUrl() . '/'); + $this->assertEqual($this->container->get('url_generator')->generateFromPath(''), $context->getBaseUrl() . '/'); + } + + /** * Checks that an ajax request gets rendered as an Ajax response, by mime. * * @todo This test will not work until the Ajax enhancer is corrected. However, diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml index be35f3f..8331723 100644 --- a/core/modules/system/system.routing.yml +++ b/core/modules/system/system.routing.yml @@ -225,3 +225,4 @@ front: pattern: '/' requirements: _access: 'TRUE' +