function RedirectDestinationTest::setupUrlGenerator
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php \Drupal\Tests\Core\Routing\RedirectDestinationTest::setupUrlGenerator()
- 10 core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php \Drupal\Tests\Core\Routing\RedirectDestinationTest::setupUrlGenerator()
- 9 core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php \Drupal\Tests\Core\Routing\RedirectDestinationTest::setupUrlGenerator()
- 8.9.x core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php \Drupal\Tests\Core\Routing\RedirectDestinationTest::setupUrlGenerator()
3 calls to RedirectDestinationTest::setupUrlGenerator()
- RedirectDestinationTest::testGet in core/
tests/ Drupal/ Tests/ Core/ Routing/ RedirectDestinationTest.php - Tests destination passed via $_GET.
- RedirectDestinationTest::testGetAsArray in core/
tests/ Drupal/ Tests/ Core/ Routing/ RedirectDestinationTest.php - Tests get as array.
- RedirectDestinationTest::testSetAfterGetCall in core/
tests/ Drupal/ Tests/ Core/ Routing/ RedirectDestinationTest.php - Tests set after get call.
File
-
core/
tests/ Drupal/ Tests/ Core/ Routing/ RedirectDestinationTest.php, line 56
Class
Namespace
Drupal\Tests\Core\RoutingCode
protected function setupUrlGenerator() : void {
$this->urlGenerator
->method('generateFromRoute')
->willReturnCallback(function ($route, $parameters, array $options) : string {
$query_string = '';
if (!empty($options['query'])) {
$query_string = '?' . UrlHelper::buildQuery($options['query']);
}
return '/current-path' . $query_string;
});
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.