diff --git a/core/tests/Drupal/KernelTests/AssertContentTrait.php b/core/tests/Drupal/KernelTests/AssertContentTrait.php
index 223d5ea662c034e7ef0bc098f85442cf4a24a1d8..84884e674b2441f35e86e613c4e3e10aeb16f498 100644
--- a/core/tests/Drupal/KernelTests/AssertContentTrait.php
+++ b/core/tests/Drupal/KernelTests/AssertContentTrait.php
@@ -56,7 +56,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) {