diff --git a/core/lib/Drupal/Core/Extension/ModuleDependencyMessageTrait.php b/core/lib/Drupal/Core/Extension/ModuleDependencyMessageTrait.php
index 4511f423df1a1e1e92dc4442926c6990238ce3f8..6fef0d9a6a7c47ecfdef14eb9a6888436d87f238 100644
--- a/core/lib/Drupal/Core/Extension/ModuleDependencyMessageTrait.php
+++ b/core/lib/Drupal/Core/Extension/ModuleDependencyMessageTrait.php
@@ -49,6 +49,8 @@ public function checkDependencyMessage(array $modules, $dependency, Dependency $
         ]);
       }
     }
+
+    return NULL;
   }
 
 }
diff --git a/core/lib/Drupal/Core/Plugin/PluginWithFormsTrait.php b/core/lib/Drupal/Core/Plugin/PluginWithFormsTrait.php
index 6181b866515f536dfe6630ad8e438eb39b4aaea6..11b2d6ec9c89235091e0ea06a3523cff180d4161 100644
--- a/core/lib/Drupal/Core/Plugin/PluginWithFormsTrait.php
+++ b/core/lib/Drupal/Core/Plugin/PluginWithFormsTrait.php
@@ -17,6 +17,7 @@ public function getFormClass($operation) {
     elseif ($operation === 'configure' && $this instanceof PluginFormInterface) {
       return static::class;
     }
+    return NULL;
   }
 
   /**
diff --git a/core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php b/core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php
index 6a76bb8743ca1f870508db4872aa8b3e8bd3247a..986af08a58bddf51411ccba5d0023e6d5b9f5a5a 100644
--- a/core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php
+++ b/core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php
@@ -4,6 +4,7 @@
 
 namespace Drupal\Tests\content_moderation\Traits;
 
+use Drupal\content_moderation\Plugin\WorkflowType\ContentModerationInterface;
 use Drupal\workflows\Entity\Workflow;
 use Drupal\workflows\WorkflowInterface;
 
@@ -103,8 +104,11 @@ protected function createEditorialWorkflow() {
    *   The bundle ID to add.
    */
   protected function addEntityTypeAndBundleToWorkflow(WorkflowInterface $workflow, $entity_type_id, $bundle) {
-    $workflow->getTypePlugin()->addEntityTypeAndBundle($entity_type_id, $bundle);
-    $workflow->save();
+    $moderation = $workflow->getTypePlugin();
+    if ($moderation instanceof ContentModerationInterface) {
+      $moderation->addEntityTypeAndBundle($entity_type_id, $bundle);
+      $workflow->save();
+    }
   }
 
 }
diff --git a/core/modules/media/tests/src/Traits/MediaTypeCreationTrait.php b/core/modules/media/tests/src/Traits/MediaTypeCreationTrait.php
index 8059c9ca9c5e01feaa1d48fb985c8a71f9887aca..b0fd28fc5332d2f2a42d2c146562ff5646e553e1 100644
--- a/core/modules/media/tests/src/Traits/MediaTypeCreationTrait.php
+++ b/core/modules/media/tests/src/Traits/MediaTypeCreationTrait.php
@@ -54,7 +54,9 @@ protected function createMediaType($source_plugin_id, array $values = []) {
     // The media type form creates a source field if it does not exist yet. The
     // same must be done in a kernel test, since it does not use that form.
     // @see \Drupal\media\MediaTypeForm::save()
-    $source_field->getFieldStorageDefinition()->save();
+    /** @var \Drupal\field\FieldStorageConfigInterface $storage */
+    $storage = $source_field->getFieldStorageDefinition();
+    $storage->save();
     // The source field storage has been created, now the field can be saved.
     $source_field->save();
 
diff --git a/core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php b/core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php
index 589febbe1f02b1c6a6ae6b4c3458a89d3b8a9e5a..cf0399d7532d8de81c6b3ca50ff4035e1161b560 100644
--- a/core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php
+++ b/core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php
@@ -25,7 +25,7 @@ trait BasicAuthResourceTestTrait {
   protected function getAuthenticationRequestOptions($method): array {
     return [
       'headers' => [
-        'Authorization' => 'Basic ' . base64_encode($this->account->name->value . ':' . $this->account->passRaw),
+        'Authorization' => 'Basic ' . base64_encode($this->account->getAccountName() . ':' . $this->account->passRaw),
       ],
     ];
   }
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php
index 3275cd4c25298226d272e5cb74b403c7d1652875..c534e326d7fd251eed0b20466f32170181a0e9c1 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php
@@ -202,7 +202,13 @@ protected function createScreenshot($filename, $set_background_color = TRUE) {
   }
 
   /**
-   * {@inheritdoc}
+   * Returns WebAssert object.
+   *
+   * @param string $name
+   *   (optional) Name of the session. Defaults to the active session.
+   *
+   * @return \Drupal\FunctionalJavascriptTests\WebDriverWebAssert
+   *   A new web-assert option for asserting the presence of elements with.
    */
   public function assertSession($name = NULL) {
     return new WebDriverWebAssert($this->getSession($name), $this->baseUrl);