function UrlGeneratorTest::testEncodingOfChainedRelativePathSegments
Same name and namespace in other branches
- main core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php \Drupal\Tests\Core\Routing\UrlGeneratorTest::testEncodingOfChainedRelativePathSegments()
Tests generate with chained relative path segments.
File
-
core/
tests/ Drupal/ Tests/ Core/ Routing/ UrlGeneratorTest.php, line 572
Class
- UrlGeneratorTest
- Confirm that the UrlGenerator is functioning properly.
Namespace
Drupal\Tests\Core\RoutingCode
public function testEncodingOfChainedRelativePathSegments() : void {
$this->assertGenerateFromRoute('test_path', [
'path' => '../../..',
], [], '/test-path/%2E%2E/%2E%2E/%2E%2E/bar', (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT));
$this->assertGenerateFromRoute('test_path', [
'path' => '././.',
], [], '/test-path/%2E/%2E/%2E/bar', (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT));
$this->assertGenerateFromRoute('test_path', [
'path' => '../././..',
], [], '/test-path/%2E%2E/%2E/%2E/%2E%2E/bar', (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT));
$this->assertGenerateFromRoute('test_tail', [
'path' => '../../..',
], [], '/test-tail/%2E%2E/%2E%2E/%2E%2E', (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT));
$this->assertGenerateFromRoute('test_tail', [
'path' => '././.',
], [], '/test-tail/%2E/%2E/%2E', (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.