protected function EntityUrlLanguageTest::setCurrentRequestForRoute in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/language/src/Tests/EntityUrlLanguageTest.php \Drupal\language\Tests\EntityUrlLanguageTest::setCurrentRequestForRoute()
Sets the current request to a specific path with the corresponding route.
Parameters
string $path: The path for which the current request should be created.
string $route_name: The route name for which the route object for the request should be created.
1 call to EntityUrlLanguageTest::setCurrentRequestForRoute()
- EntityUrlLanguageTest::testEntityUrlLanguageWithLanguageContentEnabled in core/
modules/ language/ src/ Tests/ EntityUrlLanguageTest.php - Ensures correct entity URLs with the method language-content-entity enabled.
File
- core/
modules/ language/ src/ Tests/ EntityUrlLanguageTest.php, line 134 - Contains \Drupal\language\Tests\EntityUrlLanguageTest.
Class
- EntityUrlLanguageTest
- Tests the language of entity URLs. @group language
Namespace
Drupal\language\TestsCode
protected function setCurrentRequestForRoute($path, $route_name) {
$request = Request::create($path);
$request->attributes
->set(RouteObjectInterface::ROUTE_NAME, $route_name);
$request->attributes
->set(RouteObjectInterface::ROUTE_OBJECT, new Route($path));
$this->container
->get('request_stack')
->push($request);
}