Kernel tests: Url toString with language option
Solution
I could solve it by register the PathProcessorLanguage class and add the language.types and language.negotiation config.
public function register(ContainerBuilder $container) {
  parent::register($container);

  // Define the default language.
  $language = Language::$defaultValues;
  $language['id'] = 'de';
  $language['name'] = 'German';
  $container-&gt;setParameter('language.default_values', $language);

  // Register PathProcessorLanguage.
  $container-&gt;register('path_processor_language', PathProcessorLanguage::class)
    -&gt;addTag('path_processor_outbound', ['priority' =&gt; 100])
    -&gt;addArgument(new Reference('config.factory'))
    -&gt;addArgument(new Reference('language_manager'))
    -&gt;addArgument(new Reference('language_negotiator'))
    -&gt;addArgument(new Reference('current_user'))
    -&gt;addArgument(new Reference('language.config_subscriber'));
}

protected function setUp() {
  parent::setUp();

  // Add additional languages.
  ConfigurableLanguage::createFromLangcode('fr')-&gt;save();
  ConfigurableLanguage::createFromLangcode('it')-&gt;save();

  // Define language settings.
  $this-&gt;config('language.types')-&gt;setData([
    'configurable' =&gt; ['language_interface'],
    'negotiation' =&gt; [
      'language_interface' =&gt; [
        'enabled' =&gt; [
          LanguageNegotiationUrl::METHOD_ID =&gt; 0,
        ],
      ],
    ],
  ])-&gt;save();

  $languageKeys = array_keys($this-&gt;container-&gt;get('language_manager')-&gt;getLanguages());
  $this-&gt;config('language.negotiation')-&gt;setData([
    'url' =&gt; [
      'source' =&gt; LanguageNegotiationUrl::CONFIG_PATH_PREFIX,
      'prefixes' =&gt; array_combine($languageKeys, $languageKeys),
    ],
  ])-&gt;save();
}

Addition
If you want to use/test path alias configs too, just register the AliasPathProcessor class...
public function register(ContainerBuilder $container) {
  parent::register($container);

  // ...

  $container-&gt;register('path_alias.path_processor', AliasPathProcessor::class)
      -&gt;addTag('path_processor_outbound', ['priority' =&gt; 300])
      -&gt;addArgument(new Reference('path_alias.manager'));

  //...
}

... and add the path alias entry for the specific language.
protected function setUp() {
  parent::setUp();

  // ...

  $pathAlias = PathAlias::create([
      'path' =&gt; '/foo',
      'alias' =&gt; '/bar',
      'langcode' =&gt; 'it',
    ]);
    $pathAlias-&gt;save();

  // ...
}