function UrlTest::testSetRouteParameterWithUnroutedUrl
Same name and namespace in other branches
- main core/tests/Drupal/Tests/Core/UrlTest.php \Drupal\Tests\Core\UrlTest::testSetRouteParameterWithUnroutedUrl()
Tests the setRouteParameter() with an unrouted URL.
@legacy-covers ::setRouteParameter
File
-
core/
tests/ Drupal/ Tests/ Core/ UrlTest.php, line 426
Class
- UrlTest
- Tests Drupal\Core\Url.
Namespace
Drupal\Tests\CoreCode
public function testSetRouteParameterWithUnroutedUrl() : void {
$url = Url::fromUri('https://example.com');
$this->expectException(\UnexpectedValueException::class);
$this->expectExceptionMessage('https://example.com has no corresponding route.');
$url->setRouteParameter('foo', 'bar');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.