diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php
index 2c8c862..0b370c3 100644
--- a/core/modules/simpletest/src/KernelTestBase.php
+++ b/core/modules/simpletest/src/KernelTestBase.php
@@ -567,7 +567,7 @@ protected function registerStreamWrapper($scheme, $class, $type = StreamWrapperI
    * @param array $elements
    *   The elements to render.
    *
-   * @return string
+   * @return \Drupal\Component\Utility\SafeStringInterface
    *   The rendered string output (typically HTML).
    */
   protected function render(array &$elements) {
diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index 376fed2..9fbc53a 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -837,7 +837,7 @@ protected function disableModules(array $modules) {
    * @param array $elements
    *   The elements to render.
    *
-   * @return string
+   * @return \Drupal\Component\Utility\SafeStringInterface
    *   The rendered string output (typically HTML).
    */
   protected function render(array &$elements) {
