function UrlGeneratorTest::testGetPathFromRouteTrailing

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

Tests URL generation from route with trailing start and end slashes.

File

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

Class

UrlGeneratorTest
Confirm that the UrlGenerator is functioning properly.

Namespace

Drupal\Tests\Core\Routing

Code

public function testGetPathFromRouteTrailing() : void {
    $this->routeProcessorManager
        ->expects($this->once())
        ->method('processOutbound');
    $path = $this->generator
        ->getPathFromRoute('test_3');
    $this->assertEquals('test/two', $path);
}

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