function UrlGeneratorTest::testNoPath
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php \Drupal\Tests\Core\Routing\UrlGeneratorTest::testNoPath()
- 8.9.x core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php \Drupal\Tests\Core\Routing\UrlGeneratorTest::testNoPath()
- 11.x core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php \Drupal\Tests\Core\Routing\UrlGeneratorTest::testNoPath()
Tests generating a relative URL with no path.
@covers ::generateFromRoute
@dataProvider providerTestNoPath
Parameters
array $options: An array of URL options.
string $expected_url: The expected relative URL.
File
-
core/
tests/ Drupal/ Tests/ Core/ Routing/ UrlGeneratorTest.php, line 512
Class
- UrlGeneratorTest
- Confirm that the UrlGenerator is functioning properly.
Namespace
Drupal\Tests\Core\RoutingCode
public function testNoPath($options, $expected_url) : void {
$url = $this->generator
->generateFromRoute('<none>', [], $options);
$this->assertEquals($expected_url, $url);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.