diff --git a/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php b/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php
index 62f396a6ebda65a8bc176da9a3c3d1b84516d2ac..d71c38caa828cd32b0526c1c527dfea711a54503 100644
--- a/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php
+++ b/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php
@@ -106,7 +106,7 @@ protected function getHtmlOutputHeaders() {
    *
    * @see \Drupal\Tests\Listeners\VerbosePrinter::printResult()
    *
-   * @return void
+   * @phpstan-ignore missingType.return
    */
   protected function htmlOutput($message = NULL) {
     if (!$this->htmlOutputEnabled) {
@@ -126,7 +126,7 @@ protected function htmlOutput($message = NULL) {
   /**
    * Creates the directory to store browser output.
    *
-   * @return void
+   * @phpstan-ignore missingType.return
    */
   protected function initBrowserOutputFile() {
     $browserOutputFile = getenv('BROWSERTEST_OUTPUT_FILE');
diff --git a/core/tests/Drupal/Tests/HttpKernelUiHelperTrait.php b/core/tests/Drupal/Tests/HttpKernelUiHelperTrait.php
index c9fe1ac8e4c17890d4cea71740312e42f67c3ed3..218e62a72a3288dc45d8bdddcdb9c50e397d6262 100644
--- a/core/tests/Drupal/Tests/HttpKernelUiHelperTrait.php
+++ b/core/tests/Drupal/Tests/HttpKernelUiHelperTrait.php
@@ -10,7 +10,6 @@
 use Behat\Mink\Selector\SelectorsHandler;
 use Behat\Mink\Session;
 use Drupal\Core\Url;
-use Drupal\Tests\WebAssert;
 use Symfony\Component\HttpKernel\HttpKernelBrowser;
 
 /**