function UrlGeneratorTest::testUrlGenerationWithDisabledPathProcessingByRoute
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php \Drupal\Tests\Core\Routing\UrlGeneratorTest::testUrlGenerationWithDisabledPathProcessingByRoute()
- 8.9.x core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php \Drupal\Tests\Core\Routing\UrlGeneratorTest::testUrlGenerationWithDisabledPathProcessingByRoute()
- 11.x core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php \Drupal\Tests\Core\Routing\UrlGeneratorTest::testUrlGenerationWithDisabledPathProcessingByRoute()
@covers ::generateFromRoute
File
-
core/
tests/ Drupal/ Tests/ Core/ Routing/ UrlGeneratorTest.php, line 264
Class
- UrlGeneratorTest
- Confirm that the UrlGenerator is functioning properly.
Namespace
Drupal\Tests\Core\RoutingCode
public function testUrlGenerationWithDisabledPathProcessingByRoute() : void {
$path_processor = $this->prophesize(OutboundPathProcessorInterface::class);
$path_processor->processOutbound(Argument::cetera())
->shouldNotBeCalled();
$provider = $this->prophesize(RouteProviderInterface::class);
$provider->getRouteByName('test_1')
->willReturn(new Route('/test/one', [], [], [
'default_url_options' => [
'path_processing' => FALSE,
],
]));
$generator = new UrlGenerator($provider->reveal(), $path_processor->reveal(), $this->routeProcessorManager, $this->requestStack, [
'http',
'https',
]);
$generator->setContext($this->context);
$url = $generator->generateFromRoute('test_1', []);
$this->assertEquals('/test/one', $url);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.