diff options
Diffstat (limited to 'core/modules/language/tests/src')
3 files changed, 9 insertions, 0 deletions
diff --git a/core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php b/core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php index d13b923e3b72..d74a1def3940 100644 --- a/core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php +++ b/core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php @@ -10,6 +10,8 @@ use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl; use Drupal\Tests\BrowserTestBase; use Drupal\Core\Routing\RouteObjectInterface; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Session\Session; +use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Symfony\Component\Routing\Route; /** @@ -185,6 +187,7 @@ class LanguageNegotiationContentEntityTest extends BrowserTestBase { $request = Request::create($path); $request->attributes->set(RouteObjectInterface::ROUTE_NAME, $route_name); $request->attributes->set(RouteObjectInterface::ROUTE_OBJECT, new Route($path)); + $request->setSession(new Session(new MockArraySessionStorage())); $this->container->get('request_stack')->push($request); } diff --git a/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php b/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php index 7a635e114076..46f518b2194a 100644 --- a/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php +++ b/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php @@ -19,6 +19,8 @@ use Drupal\Core\Language\LanguageInterface; use Symfony\Component\HttpFoundation\Request; use Drupal\language\LanguageNegotiatorInterface; use Drupal\block\Entity\Block; +use Symfony\Component\HttpFoundation\Session\Session; +use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; /** * Tests the language UI for language switching. @@ -564,6 +566,7 @@ class LanguageUILanguageNegotiationTest extends BrowserTestBase { // Test HTTPS via current URL scheme. $request = Request::create('', 'GET', [], [], [], ['HTTPS' => 'on']); + $request->setSession(new Session(new MockArraySessionStorage())); $this->container->get('request_stack')->push($request); $italian_url = Url::fromRoute('system.admin', [], ['language' => $languages['it']])->toString(); $correct_link = 'https://' . $link; diff --git a/core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php b/core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php index 58ccffc612e7..44505aac764d 100644 --- a/core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php +++ b/core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php @@ -9,6 +9,8 @@ use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity; use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl; use Drupal\Core\Routing\RouteObjectInterface; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Session\Session; +use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Symfony\Component\Routing\Route; /** @@ -132,6 +134,7 @@ class EntityUrlLanguageTest extends LanguageTestBase { $request = Request::create($path); $request->attributes->set(RouteObjectInterface::ROUTE_NAME, $route_name); $request->attributes->set(RouteObjectInterface::ROUTE_OBJECT, new Route($path)); + $request->setSession(new Session(new MockArraySessionStorage())); $this->container->get('request_stack')->push($request); } |