diff --git a/core/tests/Drupal/KernelTests/AssertContentTrait.php b/core/tests/Drupal/KernelTests/AssertContentTrait.php
index 4b2e7de028f028bef4358effd94776b684f37594..249b933481b2fe3098c87b0890046d5745270e21 100644
--- a/core/tests/Drupal/KernelTests/AssertContentTrait.php
+++ b/core/tests/Drupal/KernelTests/AssertContentTrait.php
@@ -54,7 +54,7 @@ protected function getRawContent() {
   /**
    * Sets the raw content (e.g. HTML).
    *
-   * @param string $content
+   * @param string|\Stringable $content
    *   The raw content to set.
    */
   protected function setRawContent($content) {