How do I change the current language in a Kernel test?
Looks like I needed to call:
    \Drupal::languageManager()-&gt;reset();


No, wait, that doesn't seem to be the whole story.... ARGH.
EDIT:
For the entity to be treated as translatable and so return the right URL, I also needed to set the bundle as translatable:
    $this-&gt;entityTypeManager-&gt;getStorage('language_content_settings')-&gt;create([
      'target_entity_type_id' =&gt; 'node',
      'target_bundle' =&gt; 'page',
    ])-&gt;save();
    $this-&gt;container-&gt;get('content_translation.manager')-&gt;setEnabled('node', 'page', TRUE);