From 5b473f1cb9e024fae6edf3cfe5323a589f44aafc Mon Sep 17 00:00:00 2001
From: catch <6915-catch@users.noreply.drupalcode.org>
Date: Sat, 17 Aug 2024 08:57:47 +0900
Subject: [PATCH] Issue #3385844 by pooja_sharma, joachim:
 RouteCachingLanguageTest should use API to set up language

(cherry picked from commit ae99debe8c79cbc8d9a81987ac7c5e123625d1a1)
---
 .../Routing/RouteCachingLanguageTest.php             | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php b/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php
index 9e6e8b91af88..e9e0f5e7370d 100644
--- a/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php
+++ b/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php
@@ -108,12 +108,12 @@ protected function setUp(): void {
 
     // Enable URL language detection and selection and set a prefix for both
     // languages.
-    $edit = ['language_interface[enabled][language-url]' => 1];
-    $this->drupalGet('admin/config/regional/language/detection');
-    $this->submitForm($edit, 'Save settings');
-    $edit = ['prefix[en]' => 'en'];
-    $this->drupalGet('admin/config/regional/language/detection/url');
-    $this->submitForm($edit, 'Save configuration');
+    \Drupal::configFactory()->getEditable('language.types')
+      ->set('negotiation.language_interface.enabled.language_url', 1)
+      ->save();
+    \Drupal::configFactory()->getEditable('language.negotiation')
+      ->set('url.prefixes.en', 'en')
+      ->save();
 
     // Reset the cache after changing the negotiation settings as that changes
     // how links are built.
-- 
GitLab