doRunTest example

    $edit = ['selected_langcode' => $langcode];
    $this->drupalGet('admin/config/regional/language/detection/selected');
    $this->submitForm($edit, 'Save configuration');
    $test = [
      'language_negotiation' => [LanguageNegotiationSelected::METHOD_ID],
      'path' => 'admin/config',
      'expect' => $language_string,
      'expected_method_id' => LanguageNegotiationSelected::METHOD_ID,
      'http_header' => $http_header_browser_fallback,
      'message' => 'SELECTED: UI language is switched based on selected language.',
    ];
    $this->doRunTest($test);

    // An invalid language is selected.     $this->config('language.negotiation')->set('selected_langcode', NULL)->save();
    $test = [
      'language_negotiation' => [LanguageNegotiationSelected::METHOD_ID],
      'path' => 'admin/config',
      'expect' => $default_string,
      'expected_method_id' => LanguageNegotiatorInterface::METHOD_ID,
      'http_header' => $http_header_browser_fallback,
      'message' => 'SELECTED > DEFAULT: UI language is switched based on selected language.',
    ];
    
Home | Imprint | This part of the site doesn't use cookies.