function UrlGeneratorTest::testUrlGenerationWithDisabledPathProcessing

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php \Drupal\Tests\Core\Routing\UrlGeneratorTest::testUrlGenerationWithDisabledPathProcessing()
  2. 8.9.x core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php \Drupal\Tests\Core\Routing\UrlGeneratorTest::testUrlGenerationWithDisabledPathProcessing()
  3. 11.x core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php \Drupal\Tests\Core\Routing\UrlGeneratorTest::testUrlGenerationWithDisabledPathProcessing()

@covers ::generateFromRoute

File

core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php, line 250

Class

UrlGeneratorTest
Confirm that the UrlGenerator is functioning properly.

Namespace

Drupal\Tests\Core\Routing

Code

public function testUrlGenerationWithDisabledPathProcessing() : void {
    $path_processor = $this->prophesize(OutboundPathProcessorInterface::class);
    $path_processor->processOutbound(Argument::cetera())
        ->shouldNotBeCalled();
    $generator = new UrlGenerator($this->provider, $path_processor->reveal(), $this->routeProcessorManager, $this->requestStack, [
        'http',
        'https',
    ]);
    $generator->setContext($this->context);
    $url = $this->generator
        ->generateFromRoute('test_1', [], [
        'path_processing' => FALSE,
    ]);
    $this->assertEquals('/test/one', $url);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.