From 92836c436bf7d866c15bdcada064ab201d4b2d07 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Mon, 22 Nov 2021 15:25:32 +0000
Subject: [PATCH] Issue #3138078 by mondrake, larowlan, longwave, xjm: [D9.3
 beta - w/c Nov 8, 2021] Add a 'void' return typehint to custom assert*
 methods

---
 .../Kernel/Migrate/d6/MigrateActionsTest.php  |  4 +-
 .../Kernel/Migrate/d7/MigrateActionsTest.php  |  4 +-
 .../tests/src/Functional/BigPipeTest.php      | 38 ++++++++++----
 .../tests/src/Kernel/BlockViewBuilderTest.php |  4 +-
 .../Kernel/Migrate/d6/MigrateBlockTest.php    |  6 ++-
 .../Kernel/Migrate/d7/MigrateBlockTest.php    |  6 ++-
 .../Views/BlockContentFieldFilterTest.php     |  4 +-
 .../Views/BlockContentIntegrationTest.php     |  4 +-
 .../MigrateBlockContentEntityDisplayTest.php  |  4 +-
 ...grateBlockContentEntityFormDisplayTest.php |  4 +-
 .../BookJavascriptTest.php                    |  4 +-
 .../tests/src/Kernel/BookMultilingualTest.php |  8 ++-
 .../tests/src/Kernel/CKEditorTest.php         |  4 +-
 .../src/FunctionalJavascript/MediaTest.php    |  6 ++-
 .../tests/src/Functional/CommentPagerTest.php |  4 +-
 .../src/Functional/CommentThreadingTest.php   |  8 ++-
 .../Views/CommentFieldFilterTest.php          |  4 +-
 .../src/Kernel/CommentValidationTest.php      |  4 +-
 .../d6/MigrateCommentEntityDisplayTest.php    |  4 +-
 ...ateCommentEntityFormDisplaySubjectTest.php |  8 ++-
 .../MigrateCommentEntityFormDisplayTest.php   |  4 +-
 .../d6/MigrateCommentFieldInstanceTest.php    | 10 ++--
 .../Migrate/d6/MigrateCommentFieldTest.php    |  4 +-
 .../Migrate/d6/MigrateCommentTypeTest.php     |  4 +-
 .../d7/MigrateCommentEntityDisplayTest.php    |  4 +-
 ...ateCommentEntityFormDisplaySubjectTest.php |  8 ++-
 .../MigrateCommentEntityFormDisplayTest.php   |  4 +-
 .../d7/MigrateCommentFieldInstanceTest.php    | 10 ++--
 .../Migrate/d7/MigrateCommentFieldTest.php    |  4 +-
 .../Migrate/d7/MigrateCommentTypeTest.php     |  4 +-
 .../Functional/ConfigTranslationUiTest.php    |  5 +-
 .../src/Functional/Views/ContactLinkTest.php  |  4 +-
 .../Migrate/MigrateContactCategoryTest.php    |  4 +-
 .../src/Functional/ModerationLocaleTest.php   | 16 ++++--
 .../ViewsModerationStateFilterTest.php        |  8 ++-
 ...ontentModerationStateStorageSchemaTest.php |  4 +-
 .../src/Kernel/ContentModerationStateTest.php |  4 +-
 .../src/Kernel/DefaultRevisionStateTest.php   |  4 +-
 .../ModerationStateFieldItemListTest.php      |  4 +-
 .../Kernel/ViewsModerationStateFilterTest.php |  8 ++-
 .../Kernel/ViewsModerationStateSortTest.php   |  4 +-
 .../WorkspacesContentModerationStateTest.php  |  2 +-
 ...slationOutdatedRevisionTranslationTest.php |  4 +-
 .../ContentTranslationSettingsTest.php        |  6 ++-
 .../ContentTranslationWorkflowsTest.php       |  6 ++-
 ...ontentTranslationFieldSyncRevisionTest.php |  8 ++-
 .../d6/MigrateTaxonomyTermTranslationTest.php | 24 +++++----
 .../ContextualDynamicContextTest.php          |  8 ++-
 .../src/FunctionalJavascript/EditModeTest.php |  8 ++-
 .../EntityTest/EntityTestDateonlyTest.php     |  2 +-
 .../EntityTest/EntityTestDatetimeTest.php     |  2 +-
 .../EntityTest/EntityTestDateRangeTest.php    |  2 +-
 .../src/Functional/DbLogResourceTest.php      |  2 +-
 .../dblog/tests/src/Functional/DbLogTest.php  |  4 +-
 .../Functional/EditorUploadImageScaleTest.php |  8 +--
 .../EntityReferenceAdminTest.php              |  4 +-
 ...erenceFieldTranslatedReferenceViewTest.php |  8 ++-
 .../EntityReferenceIntegrationTest.php        |  4 +-
 .../src/Functional/Number/NumberFieldTest.php |  5 +-
 .../EntityReferenceAdminTest.php              |  4 +-
 .../EntityReference/Views/SelectionTest.php   |  4 +-
 .../d6/MigrateFieldFormatterSettingsTest.php  |  4 +-
 .../d7/MigrateFieldFormatterSettingsTest.php  | 12 +++--
 .../Migrate/d7/MigrateFieldInstanceTest.php   | 16 ++++--
 ...MigrateFieldInstanceWidgetSettingsTest.php | 10 ++--
 .../Kernel/Migrate/d7/MigrateFieldTest.php    |  4 +-
 .../Migrate/d7/MigrateViewModesTest.php       |  4 +-
 ...dStorageConfigAccessControlHandlerTest.php |  4 +-
 .../FunctionalJavascript/FieldLayoutTest.php  |  4 +-
 .../Kernel/FieldLayoutEntityDisplayTest.php   |  6 ++-
 .../tests/src/Functional/FieldUIRouteTest.php |  4 +-
 .../src/Functional/ManageDisplayTest.php      | 42 ++++++++--------
 .../Functional/ManageFieldsFunctionalTest.php | 12 +++--
 .../ManageDisplayTest.php                     |  7 ++-
 .../tests/src/Kernel/EntityDisplayTest.php    | 20 +++-----
 .../src/Functional/FileFieldPathTest.php      |  4 +-
 .../src/Kernel/Migrate/d6/MigrateFileTest.php | 16 +++---
 .../tests/src/Functional/FilterFormTest.php   | 24 ++++-----
 .../filter/tests/src/Kernel/FilterAPITest.php |  6 ++-
 .../tests/src/Kernel/FilterKernelTest.php     | 15 ++++--
 .../Migrate/d7/MigrateFilterFormatTest.php    |  4 +-
 .../src/Functional/HelpTopicSearchTest.php    |  4 +-
 .../tests/src/Kernel/ImageFormatterTest.php   |  4 +-
 .../Migrate/d6/MigrateImageCacheTest.php      | 17 ++++---
 .../Migrate/d7/MigrateImageStylesTest.php     |  2 +-
 .../tests/src/Functional/FileUploadTest.php   |  4 +-
 .../jsonapi/tests/src/Functional/NodeTest.php |  8 ++-
 .../src/Functional/RestJsonApiUnsupported.php |  2 +-
 .../jsonapi/tests/src/Functional/UserTest.php |  4 +-
 ...eContentTaxonomyVocabularySettingsTest.php |  4 +-
 .../Kernel/Migrate/d6/MigrateLanguageTest.php |  4 +-
 ...eContentTaxonomyVocabularySettingsTest.php |  4 +-
 .../Functional/LayoutBuilderAccessTest.php    |  2 +-
 .../src/Functional/LayoutBuilderTest.php      |  4 +-
 .../src/Functional/LayoutSectionTest.php      |  4 +-
 .../FunctionalJavascript/BlockFilterTest.php  |  4 +-
 .../BlockFormMessagesTest.php                 |  4 +-
 .../ContentPreviewToggleTest.php              |  8 ++-
 .../ContextualLinksTest.php                   |  8 ++-
 .../InlineBlockPrivateFilesTest.php           | 19 ++++---
 .../FunctionalJavascript/InlineBlockTest.php  |  8 ++-
 .../LayoutBuilderDisableInteractionsTest.php  | 16 ++++--
 .../LayoutBuilderTest.php                     |  4 +-
 .../LayoutBuilderUiTest.php                   |  8 +--
 .../MoveBlockFormTest.php                     |  8 ++-
 .../TestMultiWidthLayoutsTest.php             |  4 +-
 .../tests/src/Unit/SectionTest.php            |  4 +-
 .../tests/src/Functional/LinkFieldTest.php    |  8 ++-
 .../tests/src/Functional/LinkFieldUITest.php  |  8 ++-
 .../LocaleConfigTranslationTest.php           |  4 +-
 .../src/Kernel/LocaleConfigSubscriberTest.php | 22 +++++---
 .../src/Functional/MediaRevisionTest.php      |  4 +-
 .../src/Functional/MediaUiFunctionalTest.php  | 16 ++++--
 .../CKEditorIntegrationTest.php               | 14 ++++--
 .../MediaSourceImageTest.php                  |  4 +-
 .../Kernel/MediaAccessControlHandlerTest.php  |  4 +-
 .../MediaLibraryDisplayModeTest.php           |  8 ++-
 .../ContentModerationTest.php                 |  8 ++-
 .../src/Kernel/MediaLibraryAccessTest.php     |  2 +-
 .../src/Kernel/MediaLibraryWidgetTest.php     |  6 ++-
 .../tests/src/Kernel/MenuLinksTest.php        |  4 +-
 .../Kernel/Migrate/d6/MigrateMenuLinkTest.php |  8 ++-
 .../tests/src/Kernel/HighWaterTest.php        |  8 ++-
 .../Kernel/MigrateEntityContentBaseTest.php   |  4 +-
 .../tests/src/Kernel/TrackChangesTest.php     |  8 ++-
 .../tests/src/Unit/process/FileCopyTest.php   |  6 ++-
 .../migrate/DestinationCategoryTest.php       |  4 +-
 .../migrate/source/ContentEntityTest.php      |  4 +-
 .../MigrateUpgradeFormStepsTest.php           |  4 +-
 .../tests/src/Functional/d6/Upgrade6Test.php  |  4 +-
 .../tests/src/Functional/d7/Upgrade7Test.php  |  4 +-
 .../Functional/NodeAccessBaseTableTest.php    |  6 ++-
 .../NodeAccessGrantsCacheContextTest.php      |  4 +-
 .../NodeDisplayConfigurableTest.php           |  4 +-
 .../tests/src/Functional/NodeTestBase.php     |  6 ++-
 .../src/Functional/Views/FrontPageTest.php    |  4 +-
 .../Functional/Views/NodeFieldFilterTest.php  |  4 +-
 .../Functional/Views/NodeIntegrationTest.php  |  4 +-
 .../src/Functional/Views/NodeLanguageTest.php |  4 +-
 .../Migrate/d6/MigrateNodeCompleteTest.php    |  4 +-
 .../Migrate/d6/MigrateNodeRevisionTest.php    | 50 ++++++++++---------
 .../Migrate/d7/MigrateNodeCompleteTest.php    |  4 +-
 .../Migrate/d7/MigrateNodeRevisionTest.php    | 20 ++++----
 .../src/Kernel/Migrate/d7/MigrateNodeTest.php | 10 ++--
 .../Migrate/d7/MigrateNodeTitleLabelTest.php  |  4 +-
 .../Kernel/Migrate/d7/MigrateNodeTypeTest.php |  8 +--
 .../tests/src/Kernel/NodeAccessTestBase.php   |  6 ++-
 .../src/Functional/OptionsFieldUITest.php     | 10 ++--
 .../Functional/PathContentModerationTest.php  |  4 +-
 .../Kernel/Migrate/d6/MigrateUrlAliasTest.php |  4 +-
 .../src/Functional/UrlAlterFunctionalTest.php | 16 +++---
 .../QuickEditEndPointAccessTest.php           |  4 +-
 .../LayoutBuilderQuickEditTest.php            |  6 +--
 .../src/Functional/StandardProfileTest.php    | 12 +++--
 .../Migrate/d7/MigrateRdfMappingTest.php      |  4 +-
 .../ResponsiveImageFieldDisplayTest.php       |  2 +-
 .../src/Functional/SearchAdminThemeTest.php   |  4 +-
 .../src/Functional/SearchCommentTest.php      |  4 +-
 .../SearchConfigSettingsFormTest.php          | 10 ++--
 .../SearchMultilingualEntityTest.php          |  8 ++-
 .../Migrate/d7/MigrateSearchPageTest.php      |  4 +-
 ...EntityReferenceFieldItemNormalizerTest.php |  4 +-
 .../OverriddenConfigurationTest.php           |  4 +-
 .../src/Functional/ShortcutLinksTest.php      | 11 +---
 .../Migrate/d7/MigrateShortcutSetTest.php     |  4 +-
 .../Kernel/Migrate/d7/MigrateShortcutTest.php | 14 +++---
 .../Migrate/d6/MigrateNodeCounterTest.php     |  4 +-
 .../Migrate/d7/MigrateNodeCounterTest.php     |  4 +-
 .../src/Functional/Ajax/FrameworkTest.php     |  8 +--
 .../src/Functional/Batch/ProcessingTest.php   | 11 ++--
 .../Cache/SessionExistsCacheContextTest.php   |  4 +-
 .../Common/NoJavaScriptAnonymousTest.php      |  4 +-
 .../EntityReferenceSelectionAccessTest.php    |  4 +-
 .../src/Functional/Form/ConfirmFormTest.php   |  8 +--
 .../tests/src/Functional/Form/FormTest.php    |  4 +-
 .../src/Functional/Mail/HtmlToTextTest.php    | 12 +++--
 .../src/Functional/Menu/LocalActionTest.php   |  4 +-
 .../src/Functional/Menu/LocalTasksTest.php    | 15 +++---
 .../Module/InstallUninstallTest.php           | 24 ++++++---
 .../tests/src/Functional/Pager/PagerTest.php  | 12 +++--
 .../Render/HtmlResponseAttachmentsTest.php    | 12 +++--
 .../SecurityAdvisoryTest.php                  |  8 +++
 .../Session/SessionAuthenticationTest.php     |  4 +-
 .../Functional/Session/SessionHttpsTest.php   |  8 +--
 .../src/Functional/Session/SessionTest.php    |  8 ++-
 .../Functional/System/ErrorHandlerTest.php    | 12 +++--
 .../src/Functional/System/HtaccessTest.php    |  4 +-
 .../tests/src/Functional/System/ThemeTest.php |  2 +-
 .../src/Functional/Theme/ThemeUiTest.php      |  4 +-
 .../Theme/TwigRegistryLoaderTest.php          |  4 +-
 .../src/Functional/Theme/TwigTransTest.php    |  4 +-
 .../UpdateSystem/UpdateScriptTest.php         | 12 +++--
 .../FunctionalJavascript/OffCanvasTest.php    |  4 +-
 .../Kernel/Common/FormElementsRenderTest.php  |  4 +-
 .../src/Kernel/Common/PageRenderTest.php      |  4 +-
 .../Kernel/Entity/ConfigEntityImportTest.php  |  4 +-
 .../Kernel/Extension/ModuleHandlerTest.php    |  6 ++-
 .../src/Kernel/Migrate/d7/MigrateMenuTest.php |  6 ++-
 .../SecurityAdvisoriesFetcherTest.php         |  2 +
 .../src/Kernel/Theme/TwigNamespaceTest.php    |  4 +-
 .../tests/src/Functional/TermAccessTest.php   |  6 ++-
 .../tests/src/Functional/TermParentsTest.php  |  8 ++-
 .../Views/RelationshipNodeTermDataTest.php    |  4 +-
 .../Views/TaxonomyFieldFilterTest.php         |  4 +-
 .../Views/TaxonomyTermFilterDepthTest.php     |  4 +-
 .../MigrateTermLocalizedTranslationTest.php   | 18 ++++---
 .../Migrate/d7/MigrateTaxonomyTermTest.php    | 14 +++---
 .../d7/MigrateTaxonomyTermTranslationTest.php | 14 ++++--
 .../d7/MigrateTaxonomyVocabularyTest.php      |  8 +--
 .../MigrateTermLocalizedTranslationTest.php   | 16 +++---
 .../src/Kernel/TaxonomyQueryAlterTest.php     |  4 +-
 .../Views/TaxonomyTermArgumentDepthTest.php   |  2 +
 .../Views/TaxonomyTermFilterDepthTest.php     |  2 +
 .../TextareaWithSummaryTest.php               |  4 +-
 .../text/tests/src/Kernel/TextSummaryTest.php |  4 +-
 .../src/Functional/ToolbarAdminMenuTest.php   |  4 +-
 .../Functional/ToolbarCacheContextsTest.php   |  4 +-
 .../FunctionalJavascript/TourLegacyTest.php   |  4 +-
 .../tests/src/Functional/TrackerTest.php      |  4 +-
 .../src/Functional/UpdateContribTest.php      |  4 +-
 .../src/Functional/RestRegisterUserTest.php   |  2 +-
 .../src/Functional/UserLoginHttpTest.php      | 12 +++--
 .../tests/src/Functional/UserLoginTest.php    |  9 ++--
 .../src/Functional/UserPasswordResetTest.php  | 16 ++++--
 .../src/Functional/UserRegistrationTest.php   |  4 +-
 .../d6/MigrateUserPictureD6FileTest.php       | 20 ++++----
 .../Kernel/Migrate/d6/MigrateUserRoleTest.php |  8 ++-
 .../Kernel/Migrate/d7/MigrateUserRoleTest.php |  6 ++-
 .../src/Kernel/Migrate/d7/MigrateUserTest.php | 14 +++---
 .../src/Kernel/UserAccountFormFieldsTest.php  |  4 +-
 .../tests/src/Kernel/UserValidationTest.php   |  8 ++-
 .../tests/src/Unit/PermissionHandlerTest.php  |  4 +-
 .../src/Unit/UserAccessControlHandlerTest.php |  4 +-
 .../Entity/FieldEntityTranslationTest.php     |  4 +-
 .../FieldRenderedEntityTranslationTest.php    |  4 +-
 .../src/Functional/Handler/FieldWebTest.php   | 12 ++---
 .../Functional/Plugin/DisplayPageWebTest.php  |  4 +-
 .../src/Functional/Plugin/ExposedFormTest.php |  8 ++-
 .../src/Functional/SearchIntegrationTest.php  |  6 +--
 .../PaginationAJAXTest.php                    |  4 +-
 .../CacheableMetadataCalculationTest.php      |  4 +-
 .../src/Kernel/Entity/EntityViewsDataTest.php | 44 +++++++++++-----
 .../Entity/LatestRevisionFilterTest.php       |  4 +-
 .../Kernel/Entity/RowEntityRenderersTest.php  |  8 +--
 ...sEntitySchemaSubscriberIntegrationTest.php |  4 +-
 .../Kernel/Handler/AreaDisplayLinkTest.php    | 16 ++++--
 .../src/Kernel/Handler/FieldDateTest.php      | 15 ++++--
 .../src/Kernel/Handler/FieldKernelTest.php    | 18 +++----
 .../Handler/FieldRenderedEntityTest.php       |  8 ++-
 .../views/tests/src/Kernel/ModuleTest.php     |  5 +-
 .../tests/src/Kernel/Plugin/StyleGridTest.php |  4 +-
 .../tests/src/Kernel/PluginInstanceTest.php   |  4 +-
 .../src/Kernel/RenderCacheIntegrationTest.php |  8 ++-
 .../tests/src/Kernel/ViewExecutableTest.php   |  4 +-
 .../Controller/ViewAjaxControllerTest.php     |  4 +-
 .../src/Functional/ExposedFormUITest.php      | 10 ++--
 .../tests/src/Functional/HandlerTest.php      |  4 +-
 .../src/Functional/RearrangeFieldsTest.php    |  8 +--
 .../src/FunctionalJavascript/PreviewTest.php  |  8 ++-
 .../src/Functional/PathWorkspacesTest.php     |  8 ++-
 .../src/Kernel/WorkspaceIntegrationTest.php   | 16 ++++--
 .../UninstallDefaultContentTest.php           |  6 +--
 .../src/Functional/DemoUmamiProfileTest.php   |  2 +-
 .../StandardJavascriptTest.php                |  2 +-
 .../Template/ComposerProjectTemplatesTest.php |  4 +-
 .../Ajax/AjaxTest.php                         |  8 ++-
 .../Ajax/CommandsTest.php                     |  4 +-
 .../Ajax/MessageCommandTest.php               |  8 ++-
 .../Core/JsMessageTest.php                    |  4 +-
 .../TableDrag/TableDragTest.php               | 16 ++++--
 .../Bootstrap/UncaughtExceptionTest.php       |  8 ++-
 .../KernelTests/Config/DefaultConfigTest.php  |  4 +-
 .../KernelTests/Core/Ajax/CommandsTest.php    | 10 ++--
 .../Asset/LibraryDiscoveryIntegrationTest.php | 21 ++++----
 .../Core/Config/ConfigDiffTest.php            |  4 +-
 .../Core/Database/ConnectionUnitTest.php      |  8 ++-
 .../KernelTests/Core/Database/SchemaTest.php  | 20 +++++---
 .../Core/Database/TransactionTest.php         | 16 +++---
 .../Core/Datetime/Element/TimezoneTest.php    |  8 ++-
 .../Entity/BundleConstraintValidatorTest.php  |  4 +-
 .../Core/Entity/ConfigEntityQueryTest.php     |  4 +-
 .../Entity/EntityAccessControlHandlerTest.php |  4 +-
 .../KernelTests/Core/Entity/EntityApiTest.php |  4 +-
 .../Core/Entity/EntityCrudHookTest.php        |  6 ++-
 .../Entity/EntityFieldDefaultValueTest.php    |  4 +-
 .../Core/Entity/EntityQueryAggregateTest.php  | 10 ++--
 .../Entity/EntityQueryRelationshipTest.php    |  4 +-
 .../Core/Entity/EntityQueryTest.php           | 16 ++++--
 .../Core/Entity/EntityReferenceFieldTest.php  | 12 +++--
 .../Core/Entity/EntityRepositoryTest.php      |  4 +-
 .../Core/Entity/EntityUUIDTest.php            |  4 +-
 .../Entity/FieldTranslationSqlStorageTest.php |  4 +-
 .../FieldableEntityDefinitionUpdateTest.php   | 32 +++++++++---
 .../RevisionableContentEntityBaseTest.php     |  4 +-
 .../KernelTests/Core/Field/FieldItemTest.php  |  6 ++-
 .../KernelTests/Core/File/HtaccessTest.php    |  4 +-
 .../Core/Menu/MenuTreeStorageTest.php         |  4 +-
 .../Render/Element/RenderElementTypesTest.php |  4 +-
 .../Component/Datetime/DateTimePlusTest.php   |  4 +-
 .../Tests/Component/DrupalComponentTest.php   |  6 ++-
 .../Tests/Component/Graph/GraphTest.php       | 32 +++++++-----
 .../Tests/Component/Utility/SortArrayTest.php |  4 +-
 .../Tests/Component/Utility/XssTest.php       | 12 ++---
 .../Scaffold/Functional/ScaffoldTest.php      | 16 ++++--
 .../Tests/Core/Access/AccessResultTest.php    |  5 +-
 .../Drupal/Tests/Core/Common/TagsTest.php     |  4 +-
 .../Drupal/Tests/Core/Config/ConfigTest.php   | 12 +++--
 .../Controller/ControllerResolverTest.php     |  6 ++-
 ...ityFormDisplayAccessControlHandlerTest.php |  4 +-
 .../Tests/Core/Entity/EntityTypeTest.php      |  4 +-
 .../Tests/Core/Entity/EntityUrlTest.php       |  4 +-
 .../Drupal/Tests/Core/File/FileSystemTest.php |  4 +-
 .../FormAjaxSubscriberTest.php                | 35 +++++++------
 ...EntityContextDefinitionIsSatisfiedTest.php |  4 +-
 .../Core/Render/RendererPlaceholdersTest.php  |  4 +-
 .../Drupal/Tests/Core/Render/RendererTest.php |  6 ++-
 .../Tests/Core/Routing/UrlGeneratorTest.php   |  8 +--
 .../Core/Security/RequestSanitizerTest.php    |  4 +-
 .../Tests/Core/Template/AttributeTest.php     | 16 ++++--
 .../Tests/Core/Utility/LinkGeneratorTest.php  |  9 ++--
 320 files changed, 1615 insertions(+), 783 deletions(-)

diff --git a/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php b/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php
index ee6f39740366..239c5ab0d864 100644
--- a/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php
+++ b/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php
@@ -57,8 +57,10 @@ public function testActions() {
    *   The expected Action type.
    * @param array $configuration
    *   The expected Action configuration.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $label, $type, $configuration) {
+  protected function assertEntity(string $id, string $label, string $type, array $configuration): void {
     $action = Action::load($id);
 
     $this->assertInstanceOf(Action::class, $action);
diff --git a/core/modules/action/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php b/core/modules/action/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php
index 85a6977d4232..920af405338a 100644
--- a/core/modules/action/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php
+++ b/core/modules/action/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php
@@ -57,8 +57,10 @@ public function testActions() {
    *   The expected Action type.
    * @param array $configuration
    *   The expected Action configuration.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $label, $type, $configuration) {
+  protected function assertEntity(string $id, string $label, string $type, array $configuration): void {
     $action = Action::load($id);
 
     $this->assertInstanceOf(Action::class, $action);
diff --git a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
index 21a39eb5a45a..dcb68b48430b 100644
--- a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
+++ b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
@@ -327,7 +327,10 @@ public function testBigPipeMultiOccurrencePlaceholders() {
     $this->assertSession()->responseNotContains('The count is 3.');
   }
 
-  protected function assertBigPipeResponseHeadersPresent() {
+  /**
+   * @internal
+   */
+  protected function assertBigPipeResponseHeadersPresent(): void {
     // Check that Cache-Control header set to "private".
     $this->assertSession()->responseHeaderContains('Cache-Control', 'private');
     $this->assertSession()->responseHeaderEquals('Surrogate-Control', 'no-store, content="BigPipe/1.0"');
@@ -340,8 +343,10 @@ protected function assertBigPipeResponseHeadersPresent() {
    * @param array $expected_big_pipe_nojs_placeholders
    *   Keys: BigPipe no-JS placeholder markup. Values: expected replacement
    *   markup.
+   *
+   * @internal
    */
-  protected function assertBigPipeNoJsPlaceholders(array $expected_big_pipe_nojs_placeholders) {
+  protected function assertBigPipeNoJsPlaceholders(array $expected_big_pipe_nojs_placeholders): void {
     $this->assertSetsEqual(array_keys($expected_big_pipe_nojs_placeholders), array_map('rawurldecode', explode(' ', $this->getSession()->getResponseHeader('BigPipe-Test-No-Js-Placeholders'))));
     foreach ($expected_big_pipe_nojs_placeholders as $big_pipe_nojs_placeholder => $expected_replacement) {
       // Checking whether the replacement for the BigPipe no-JS placeholder
@@ -361,8 +366,10 @@ protected function assertBigPipeNoJsPlaceholders(array $expected_big_pipe_nojs_p
    * @param array $expected_big_pipe_placeholder_stream_order
    *   Keys: BigPipe placeholder IDs. Values: expected AJAX response. Keys are
    *   defined in the order that they are expected to be rendered & streamed.
+   *
+   * @internal
    */
-  protected function assertBigPipePlaceholders(array $expected_big_pipe_placeholders, array $expected_big_pipe_placeholder_stream_order) {
+  protected function assertBigPipePlaceholders(array $expected_big_pipe_placeholders, array $expected_big_pipe_placeholder_stream_order): void {
     $this->assertSetsEqual(array_keys($expected_big_pipe_placeholders), explode(' ', $this->getSession()->getResponseHeader('BigPipe-Test-Placeholders')));
     $placeholder_positions = [];
     $placeholder_replacement_positions = [];
@@ -437,36 +444,49 @@ protected function getTestCases($has_session = TRUE) {
 
   /**
    * Asserts whether arrays A and B are equal, when treated as sets.
+   *
+   * @todo This method is broken. Fix it in
+   *   https://www.drupal.org/project/drupal/issues/3144926
+   *
+   * @internal
    */
-  protected function assertSetsEqual(array $a, array $b) {
-    return count($a) == count($b) && !array_diff_assoc($a, $b);
+  protected function assertSetsEqual(array $a, array $b): void {
+    $result = count($a) == count($b) && !array_diff_assoc($a, $b);
   }
 
   /**
    * Asserts whether a BigPipe no-JS cookie exists or not.
+   *
+   * @internal
    */
-  protected function assertBigPipeNoJsCookieExists($expected) {
+  protected function assertBigPipeNoJsCookieExists(string $expected): void {
     $this->assertCookieExists('big_pipe_nojs', $expected, 'BigPipe no-JS');
   }
 
   /**
    * Asserts whether a session cookie exists or not.
+   *
+   * @internal
    */
-  protected function assertSessionCookieExists($expected) {
+  protected function assertSessionCookieExists(string $expected): void {
     $this->assertCookieExists($this->getSessionName(), $expected, 'Session');
   }
 
   /**
    * Asserts whether a cookie exists on the client or not.
+   *
+   * @internal
    */
-  protected function assertCookieExists($cookie_name, $expected, $cookie_label) {
+  protected function assertCookieExists(string $cookie_name, string $expected, string $cookie_label): void {
     $this->assertEquals($expected, !empty($this->getSession()->getCookie($cookie_name)), $expected ? "$cookie_label cookie exists." : "$cookie_label cookie does not exist.");
   }
 
   /**
    * Calls ::performMetaRefresh() and asserts the responses.
+   *
+   * @internal
    */
-  protected function assertBigPipeNoJsMetaRefreshRedirect() {
+  protected function assertBigPipeNoJsMetaRefreshRedirect(): void {
     $original_url = $this->getSession()->getCurrentUrl();
 
     // Disable automatic following of redirects by the HTTP client, so that this
diff --git a/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php b/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
index df7fba45a3a4..03b728da7f98 100644
--- a/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
+++ b/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
@@ -288,8 +288,10 @@ public function testBlockViewBuilderBuildAlter() {
    *   The expected cache tags.
    * @param int $expected_max_age
    *   The expected max-age.
+   *
+   * @internal
    */
-  protected function assertBlockRenderedWithExpectedCacheability(array $expected_keys, array $expected_contexts, array $expected_tags, $expected_max_age) {
+  protected function assertBlockRenderedWithExpectedCacheability(array $expected_keys, array $expected_contexts, array $expected_tags, int $expected_max_age): void {
     $required_cache_contexts = ['languages:' . LanguageInterface::TYPE_INTERFACE, 'theme', 'user.permissions'];
 
     // Check that the expected cacheability metadata is present in:
diff --git a/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php b/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php
index daa3f107b646..ecbea2ffb909 100644
--- a/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php
+++ b/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php
@@ -69,14 +69,16 @@ protected function setUp(): void {
    *   The display region.
    * @param string $theme
    *   The theme.
-   * @param string $weight
+   * @param int $weight
    *   The block weight.
    * @param array $settings
    *   (optional) The block settings.
    * @param bool $status
    *   Whether the block is expected to be enabled or disabled.
+   *
+   * @internal
    */
-  public function assertEntity($id, $visibility, $region, $theme, $weight, array $settings = NULL, $status = TRUE) {
+  public function assertEntity(string $id, array $visibility, string $region, string $theme, int $weight, array $settings = NULL, bool $status = TRUE): void {
     $block = Block::load($id);
     $this->assertInstanceOf(Block::class, $block);
     $this->assertSame($visibility, $block->getVisibility());
diff --git a/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php
index 991d02142c12..a9f31b4ca3d8 100644
--- a/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php
+++ b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php
@@ -73,7 +73,7 @@ protected function setUp(): void {
    *   The display region.
    * @param string $theme
    *   The theme.
-   * @param string $weight
+   * @param int $weight
    *   The block weight.
    * @param string $label
    *   The block label.
@@ -81,8 +81,10 @@ protected function setUp(): void {
    *   The block label display setting.
    * @param bool $status
    *   Whether the block is expected to be enabled or disabled.
+   *
+   * @internal
    */
-  public function assertEntity($id, $plugin_id, array $roles, $pages, $region, $theme, $weight, $label, $label_display, $status = TRUE) {
+  public function assertEntity(string $id, string $plugin_id, array $roles, string $pages, string $region, string $theme, int $weight, string $label, string $label_display, bool $status = TRUE): void {
     $block = Block::load($id);
     $this->assertInstanceOf(Block::class, $block);
     /** @var \Drupal\block\BlockInterface $block */
diff --git a/core/modules/block_content/tests/src/Functional/Views/BlockContentFieldFilterTest.php b/core/modules/block_content/tests/src/Functional/Views/BlockContentFieldFilterTest.php
index 280f0e81371b..60249e60e47f 100644
--- a/core/modules/block_content/tests/src/Functional/Views/BlockContentFieldFilterTest.php
+++ b/core/modules/block_content/tests/src/Functional/Views/BlockContentFieldFilterTest.php
@@ -99,8 +99,10 @@ public function testFilters() {
    *   that translation should be shown on the given page.
    * @param string $message
    *   Message suffix to display.
+   *
+   * @internal
    */
-  protected function assertPageCounts($path, $counts, $message) {
+  protected function assertPageCounts(string $path, array $counts, string $message): void {
     // Get the text of the page.
     $this->drupalGet($path);
     $text = $this->getTextContent();
diff --git a/core/modules/block_content/tests/src/Functional/Views/BlockContentIntegrationTest.php b/core/modules/block_content/tests/src/Functional/Views/BlockContentIntegrationTest.php
index e3053e4be304..f47660906dad 100644
--- a/core/modules/block_content/tests/src/Functional/Views/BlockContentIntegrationTest.php
+++ b/core/modules/block_content/tests/src/Functional/Views/BlockContentIntegrationTest.php
@@ -59,8 +59,10 @@ public function testBlockContentViewTypeArgument() {
    *
    * @param array $expected_ids
    *   An array of block_content IDs.
+   *
+   * @internal
    */
-  protected function assertIds(array $expected_ids = []) {
+  protected function assertIds(array $expected_ids = []): void {
     $result = $this->xpath('//span[@class="field-content"]');
     $ids = [];
     foreach ($result as $element) {
diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityDisplayTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityDisplayTest.php
index 509230d98f13..32bb55a038ad 100644
--- a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityDisplayTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityDisplayTest.php
@@ -38,8 +38,10 @@ protected function setUp(): void {
    *   The entity ID.
    * @param string $component_id
    *   The ID of the display component.
+   *
+   * @internal
    */
-  protected function assertDisplay($id, $component_id) {
+  protected function assertDisplay(string $id, string $component_id): void {
     $component = EntityViewDisplay::load($id)->getComponent($component_id);
     $this->assertIsArray($component);
     $this->assertSame('hidden', $component['label']);
diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityFormDisplayTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityFormDisplayTest.php
index eb424395c8db..6d21b99d9d15 100644
--- a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityFormDisplayTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityFormDisplayTest.php
@@ -38,8 +38,10 @@ protected function setUp(): void {
    *   The entity ID.
    * @param string $component_id
    *   The ID of the form component.
+   *
+   * @internal
    */
-  protected function assertDisplay($id, $component_id) {
+  protected function assertDisplay(string $id, string $component_id): void {
     $component = EntityFormDisplay::load($id)->getComponent($component_id);
     $this->assertIsArray($component);
     $this->assertSame('text_textarea_with_summary', $component['type']);
diff --git a/core/modules/book/tests/src/FunctionalJavascript/BookJavascriptTest.php b/core/modules/book/tests/src/FunctionalJavascript/BookJavascriptTest.php
index cb4ac799b426..33f0c253f45e 100644
--- a/core/modules/book/tests/src/FunctionalJavascript/BookJavascriptTest.php
+++ b/core/modules/book/tests/src/FunctionalJavascript/BookJavascriptTest.php
@@ -143,9 +143,11 @@ public function testBookOrdering() {
    * @throws \Behat\Mink\Exception\ExpectationException
    *   When any of the given string is not found.
    *
+   * @internal
+   *
    * @todo Remove this once https://www.drupal.org/node/2817657 is committed.
    */
-  protected function assertOrderInPage(array $items) {
+  protected function assertOrderInPage(array $items): void {
     $session = $this->getSession();
     $text = $session->getPage()->getHtml();
     $strings = [];
diff --git a/core/modules/book/tests/src/Kernel/BookMultilingualTest.php b/core/modules/book/tests/src/Kernel/BookMultilingualTest.php
index 38bcdcffc382..033b9ae65bfb 100644
--- a/core/modules/book/tests/src/Kernel/BookMultilingualTest.php
+++ b/core/modules/book/tests/src/Kernel/BookMultilingualTest.php
@@ -289,6 +289,8 @@ protected function setCurrentLanguage(string $langcode): void {
    *   A book tree item.
    * @param string $langcode
    *   The language code for the requested translation.
+   *
+   * @internal
    */
   protected function assertBookItemIsCorrectlyTranslated(array $item, string $langcode): void {
     $this->assertNodeLinkIsCorrectlyTranslated($item['original_link']['nid'], $item['title'], $item['url'], $langcode);
@@ -305,6 +307,8 @@ protected function assertBookItemIsCorrectlyTranslated(array $item, string $lang
    *   The URL being tested.
    * @param string $langcode
    *   The language code.
+   *
+   * @internal
    */
   protected function assertNodeLinkIsCorrectlyTranslated(int $nid, string $title, Url $url, string $langcode): void {
     $node = Node::load($nid);
@@ -324,8 +328,10 @@ protected function assertNodeLinkIsCorrectlyTranslated(int $nid, string $title,
    *   The node ID.
    * @param string $indent
    *   The indentation before the actual table of contents label.
+   *
+   * @internal
    */
-  protected function assertToCEntryIsCorrectlyTranslated(array $toc, string $langcode, int $nid, string $indent) {
+  protected function assertToCEntryIsCorrectlyTranslated(array $toc, string $langcode, int $nid, string $indent): void {
     $node = Node::load($nid);
     $node_label = $node->getTranslation($langcode)->label();
     $this->assertSame($indent . ' ' . $node_label, $toc[$nid]);
diff --git a/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php b/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php
index f70fd87d0740..3f852ef8e313 100644
--- a/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php
+++ b/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php
@@ -473,8 +473,10 @@ public function testExternalStylesheets() {
    * @param string $langcode
    *   Language code to assert for. Defaults to French. That is the default
    *   language set in this assertion.
+   *
+   * @internal
    */
-  protected function assertCKEditorLanguage($langcode = 'fr') {
+  protected function assertCKEditorLanguage(string $langcode = 'fr'): void {
     // Set French as the site default language.
     ConfigurableLanguage::createFromLangcode('fr')->save();
     $this->config('system.site')->set('default_langcode', 'fr')->save();
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php
index 0d3f6fe7542a..8fb14f18d9da 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php
@@ -664,11 +664,13 @@ public function testViewMode() {
    *
    * @param string $attribute
    *   The attribute to check.
-   * @param mixed $value
+   * @param string|null $value
    *   Either a string value or if NULL, asserts that <drupal-media> element
    *   doesn't have the attribute.
+   *
+   * @internal
    */
-  protected function assertSourceAttributeSame($attribute, $value) {
+  protected function assertSourceAttributeSame(string $attribute, ?string $value): void {
     $dom = $this->getEditorDataAsDom();
     $drupal_media = (new \DOMXPath($dom))->query('//drupal-media');
     $this->assertNotEmpty($drupal_media);
diff --git a/core/modules/comment/tests/src/Functional/CommentPagerTest.php b/core/modules/comment/tests/src/Functional/CommentPagerTest.php
index ef4fe3c018fe..aea7bb10d5db 100644
--- a/core/modules/comment/tests/src/Functional/CommentPagerTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentPagerTest.php
@@ -210,8 +210,10 @@ public function testCommentOrderingThreading() {
    *   An array of comments, must be of the type CommentInterface.
    * @param array $expected_order
    *   An array of keys from $comments describing the expected order.
+   *
+   * @internal
    */
-  public function assertCommentOrder(array $comments, array $expected_order) {
+  public function assertCommentOrder(array $comments, array $expected_order): void {
     $expected_cids = [];
 
     // First, rekey the expected order by cid.
diff --git a/core/modules/comment/tests/src/Functional/CommentThreadingTest.php b/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
index 00ccd29c2498..55ad7b4168b0 100644
--- a/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
@@ -131,8 +131,10 @@ public function testCommentThreading() {
    *   The comment ID to check.
    * @param int $pid
    *   The expected parent comment ID.
+   *
+   * @internal
    */
-  protected function assertParentLink($cid, $pid) {
+  protected function assertParentLink(int $cid, int $pid): void {
     // This pattern matches a markup structure like:
     // @code
     // <a id="comment-2"></a>
@@ -152,8 +154,10 @@ protected function assertParentLink($cid, $pid) {
    *
    * @param int $cid
    *   The comment ID to check.
+   *
+   * @internal
    */
-  protected function assertNoParentLink($cid) {
+  protected function assertNoParentLink(int $cid): void {
     // This pattern matches a markup structure like:
     // @code
     // <a id="comment-2"></a>
diff --git a/core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php b/core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php
index 9be47fc8e215..623d75c1c4f7 100644
--- a/core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php
@@ -108,8 +108,10 @@ public function testFilters() {
    *   that translation should be shown on the given page.
    * @param string $message
    *   Message suffix to display.
+   *
+   * @internal
    */
-  protected function assertPageCounts($path, $counts, $message) {
+  protected function assertPageCounts(string $path, array $counts, string $message): void {
     // Get the text of the page.
     $this->drupalGet($path);
     $text = $this->getTextContent();
diff --git a/core/modules/comment/tests/src/Kernel/CommentValidationTest.php b/core/modules/comment/tests/src/Kernel/CommentValidationTest.php
index 39b842400dae..2e6af3207013 100644
--- a/core/modules/comment/tests/src/Kernel/CommentValidationTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentValidationTest.php
@@ -189,8 +189,10 @@ public function testValidation() {
    *   The field that violates the maximum length.
    * @param int $length
    *   Number of characters that was exceeded.
+   *
+   * @internal
    */
-  protected function assertLengthViolation(CommentInterface $comment, $field_name, $length) {
+  protected function assertLengthViolation(CommentInterface $comment, string $field_name, int $length): void {
     $violations = $comment->validate();
     $this->assertCount(1, $violations, "Violation found when $field_name is too long.");
     $this->assertEquals("{$field_name}.0.value", $violations[0]->getPropertyPath());
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityDisplayTest.php
index b4a670562f1c..f2741270cec9 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityDisplayTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityDisplayTest.php
@@ -41,8 +41,10 @@ protected function setUp(): void {
    *   The entity ID.
    * @param string $component_id
    *   The ID of the display component.
+   *
+   * @internal
    */
-  protected function assertDisplay($id, $component_id) {
+  protected function assertDisplay(string $id, string $component_id): void {
     $component = EntityViewDisplay::load($id)->getComponent($component_id);
     $this->assertIsArray($component);
     $this->assertSame('hidden', $component['label']);
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplaySubjectTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplaySubjectTest.php
index a57c2250fb42..57fb3d3849b2 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplaySubjectTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplaySubjectTest.php
@@ -35,8 +35,10 @@ protected function setUp(): void {
    *
    * @param string $id
    *   The entity form display ID.
+   *
+   * @internal
    */
-  protected function assertSubjectVisible($id) {
+  protected function assertSubjectVisible(string $id): void {
     $component = EntityFormDisplay::load($id)->getComponent('subject');
     $this->assertIsArray($component);
     $this->assertSame('string_textfield', $component['type']);
@@ -48,8 +50,10 @@ protected function assertSubjectVisible($id) {
    *
    * @param string $id
    *   The entity form display ID.
+   *
+   * @internal
    */
-  protected function assertSubjectNotVisible($id) {
+  protected function assertSubjectNotVisible(string $id): void {
     $component = EntityFormDisplay::load($id)->getComponent('subject');
     $this->assertNull($component);
   }
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplayTest.php
index 5438c938c25b..8c1bec00d645 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplayTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplayTest.php
@@ -40,8 +40,10 @@ protected function setUp(): void {
    *   The entity ID.
    * @param string $component_id
    *   The ID of the form component.
+   *
+   * @internal
    */
-  protected function assertDisplay($id, $component_id) {
+  protected function assertDisplay(string $id, string $component_id): void {
     $component = EntityFormDisplay::load($id)->getComponent($component_id);
     $this->assertIsArray($component);
     $this->assertSame('comment_default', $component['type']);
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php
index fab1c5120412..2bea5867d017 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php
@@ -45,14 +45,16 @@ protected function setUp(): void {
    *   The field's default_mode setting.
    * @param int $per_page
    *   The field's per_page setting.
-   * @param bool $anonymous
+   * @param int $anonymous
    *   The field's anonymous setting.
-   * @param int $form_location
+   * @param bool $form_location
    *   The field's form_location setting.
-   * @param bool $preview
+   * @param int $preview
    *   The field's preview setting.
+   *
+   * @internal
    */
-  protected function assertEntity($bundle, $field_name, $default_value, $default_mode, $per_page, $anonymous, $form_location, $preview) {
+  protected function assertEntity(string $bundle, string $field_name, int $default_value, int $default_mode, int $per_page, int $anonymous, bool $form_location, int $preview): void {
     $entity = FieldConfig::load("node.$bundle.$field_name");
     $this->assertInstanceOf(FieldConfig::class, $entity);
     $this->assertSame('node', $entity->getTargetEntityTypeId());
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php
index e2a865cd7c98..f16e1da2e954 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php
@@ -35,8 +35,10 @@ protected function setUp(): void {
    *
    * @param string $comment_type
    *   The comment type.
+   *
+   * @internal
    */
-  protected function assertEntity($comment_type) {
+  protected function assertEntity(string $comment_type): void {
     $entity = FieldStorageConfig::load('node.' . $comment_type);
     $this->assertInstanceOf(FieldStorageConfig::class, $entity);
     $this->assertSame('node', $entity->getTargetEntityTypeId());
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php
index 359116b88222..0fe36155d818 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php
@@ -25,8 +25,10 @@ class MigrateCommentTypeTest extends MigrateDrupal6TestBase {
    *   The entity ID.
    * @param string $label
    *   The entity label.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $label) {
+  protected function assertEntity(string $id, string $label): void {
     $entity = CommentType::load($id);
     $this->assertInstanceOf(CommentType::class, $entity);
     $this->assertSame($label, $entity->label());
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php
index 1ace7293f0f8..83709fdf0a34 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php
@@ -39,8 +39,10 @@ protected function setUp(): void {
    *   The entity ID.
    * @param string $component_id
    *   The ID of the display component.
+   *
+   * @internal
    */
-  protected function assertDisplay($id, $component_id) {
+  protected function assertDisplay(string $id, string $component_id): void {
     $component = EntityViewDisplay::load($id)->getComponent($component_id);
     $this->assertIsArray($component);
     $this->assertSame('hidden', $component['label']);
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php
index c0a1de628cd4..803198349885 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php
@@ -32,8 +32,10 @@ protected function setUp(): void {
    *
    * @param string $id
    *   The entity form display ID.
+   *
+   * @internal
    */
-  protected function assertSubjectVisible($id) {
+  protected function assertSubjectVisible(string $id): void {
     $component = EntityFormDisplay::load($id)->getComponent('subject');
     $this->assertIsArray($component);
     $this->assertSame('string_textfield', $component['type']);
@@ -45,8 +47,10 @@ protected function assertSubjectVisible($id) {
    *
    * @param string $id
    *   The entity form display ID.
+   *
+   * @internal
    */
-  protected function assertSubjectNotVisible($id) {
+  protected function assertSubjectNotVisible(string $id): void {
     $component = EntityFormDisplay::load($id)->getComponent('subject');
     $this->assertNull($component);
   }
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php
index 05d1651bc973..51c7dbdf9171 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php
@@ -39,8 +39,10 @@ protected function setUp(): void {
    *   The entity ID.
    * @param string $component_id
    *   The ID of the form component.
+   *
+   * @internal
    */
-  protected function assertDisplay($id, $component_id) {
+  protected function assertDisplay(string $id, string $component_id): void {
     $component = EntityFormDisplay::load($id)->getComponent($component_id);
     $this->assertIsArray($component);
     $this->assertSame('comment_default', $component['type']);
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php
index e1fd26c66cba..ccf447a33ea7 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php
@@ -44,14 +44,16 @@ protected function setUp(): void {
    *   The field's default_mode setting.
    * @param int $per_page
    *   The field's per_page setting.
-   * @param bool $anonymous
+   * @param int $anonymous
    *   The field's anonymous setting.
-   * @param int $form_location
+   * @param bool $form_location
    *   The field's form_location setting.
-   * @param bool $preview
+   * @param int $preview
    *   The field's preview setting.
+   *
+   * @internal
    */
-  protected function assertEntity($bundle, $field_name, $default_value, $default_mode, $per_page, $anonymous, $form_location, $preview) {
+  protected function assertEntity(string $bundle, string $field_name, int $default_value, int $default_mode, int $per_page, int $anonymous, bool $form_location, int $preview): void {
     $entity = FieldConfig::load("node.$bundle.$field_name");
     $this->assertInstanceOf(FieldConfig::class, $entity);
     $this->assertSame('node', $entity->getTargetEntityTypeId());
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php
index 25e67d239f8f..be068b9f41b5 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php
@@ -32,8 +32,10 @@ protected function setUp(): void {
    *
    * @param string $comment_type
    *   The comment type.
+   *
+   * @internal
    */
-  protected function assertEntity($comment_type) {
+  protected function assertEntity(string $comment_type): void {
     $entity = FieldStorageConfig::load('node.' . $comment_type);
     $this->assertInstanceOf(FieldStorageConfig::class, $entity);
     $this->assertSame('node', $entity->getTargetEntityTypeId());
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php
index 0da71b7b14bb..93d899aaf2bb 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php
@@ -25,8 +25,10 @@ class MigrateCommentTypeTest extends MigrateDrupal7TestBase {
    *   The entity ID.
    * @param string $label
    *   The entity label.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $label) {
+  protected function assertEntity(string $id, string $label): void {
     $entity = CommentType::load($id);
     $this->assertInstanceOf(CommentType::class, $entity);
     $this->assertSame($label, $entity->label());
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
index 50a74e205691..1fd76ccaff37 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
@@ -1186,10 +1186,9 @@ protected function renderContextualLinks($ids, $current_path) {
    * @param string $id
    *   The HTML ID of the textarea.
    *
-   * @return bool
-   *   TRUE if the assertion passed; FALSE otherwise.
+   * @internal
    */
-  protected function assertDisabledTextarea($id) {
+  protected function assertDisabledTextarea(string $id): void {
     $textarea = $this->assertSession()->fieldDisabled($id);
     $this->assertSame('textarea', $textarea->getTagName());
     $this->assertSame('This field has been disabled because you do not have sufficient permissions to edit it.', $textarea->getText());
diff --git a/core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php b/core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php
index 6a8da2203b91..ea07bc57b5d1 100644
--- a/core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php
+++ b/core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php
@@ -98,8 +98,10 @@ public function testContactLink() {
    *   All user objects used by the test.
    * @param array $names
    *   Users which should have contact links.
+   *
+   * @internal
    */
-  public function assertContactLinks(array $accounts, array $names) {
+  public function assertContactLinks(array $accounts, array $names): void {
     $this->assertSession()->elementsCount('xpath', '//div[contains(@class, "views-field-contact")]//a', count($names));
     foreach ($names as $name) {
       $account_url = $accounts[$name]->toUrl('contact-form')->toString();
diff --git a/core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php b/core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php
index c6b3ea5ed3f7..178cbc6643d2 100644
--- a/core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php
+++ b/core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php
@@ -41,8 +41,10 @@ protected function setUp(): void {
    *   The expected reply message.
    * @param int $expected_weight
    *   The contact form's expected weight.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $expected_label, array $expected_recipients, $expected_reply, $expected_weight) {
+  protected function assertEntity(string $id, string $expected_label, array $expected_recipients, string $expected_reply, int $expected_weight): void {
     /** @var \Drupal\contact\ContactFormInterface $entity */
     $entity = ContactForm::load($id);
     $this->assertInstanceOf(ContactFormInterface::class, $entity);
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php
index a23011d2137f..caa404af6a5c 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php
@@ -505,8 +505,10 @@ protected function loadTranslation(NodeInterface $node, $langcode) {
    *
    * @param \Drupal\node\NodeInterface $node
    *   A node object.
+   *
+   * @internal
    */
-  public function assertLatestVersionPage(NodeInterface $node) {
+  public function assertLatestVersionPage(NodeInterface $node): void {
     $this->assertEquals($node->toUrl('latest-version')->setAbsolute()->toString(), $this->getSession()->getCurrentUrl());
     $this->assertModerationForm($node);
   }
@@ -519,8 +521,10 @@ public function assertLatestVersionPage(NodeInterface $node) {
    * @param bool $moderation_form
    *   (optional) Whether the page should contain the moderation form. Defaults
    *   to FALSE.
+   *
+   * @internal
    */
-  public function assertNotLatestVersionPage(NodeInterface $node, $moderation_form = FALSE) {
+  public function assertNotLatestVersionPage(NodeInterface $node, bool $moderation_form = FALSE): void {
     $this->assertNotEquals($node->toUrl('latest-version')->setAbsolute()->toString(), $this->getSession()->getCurrentUrl());
     if ($moderation_form) {
       $this->assertModerationForm($node, FALSE);
@@ -538,8 +542,10 @@ public function assertNotLatestVersionPage(NodeInterface $node, $moderation_form
    * @param bool $latest_tab
    *   (optional) Whether the node form is expected to be displayed on the
    *   latest version page or on the node view page. Defaults to the former.
+   *
+   * @internal
    */
-  public function assertModerationForm(NodeInterface $node, $latest_tab = TRUE) {
+  public function assertModerationForm(NodeInterface $node, bool $latest_tab = TRUE): void {
     $this->drupalGet($node->toUrl());
     $this->assertEquals(!$latest_tab, $this->hasModerationForm());
     $this->drupalGet($node->toUrl('latest-version'));
@@ -551,8 +557,10 @@ public function assertModerationForm(NodeInterface $node, $latest_tab = TRUE) {
    *
    * @param \Drupal\node\NodeInterface $node
    *   A node object.
+   *
+   * @internal
    */
-  public function assertNoModerationForm(NodeInterface $node) {
+  public function assertNoModerationForm(NodeInterface $node): void {
     $this->drupalGet($node->toUrl());
     $this->assertFalse($this->hasModerationForm());
     $this->drupalGet($node->toUrl('latest-version'));
diff --git a/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php b/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
index b78e0938b08c..286bbcfedcc0 100644
--- a/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
@@ -327,8 +327,10 @@ public function testFilterRenderCache() {
    * @param bool $check_size
    *   (optional) Whether to check that size of the select element is not
    *   greater than 8. Defaults to FALSE.
+   *
+   * @internal
    */
-  protected function assertFilterStates($states, $check_size = FALSE) {
+  protected function assertFilterStates(array $states, bool $check_size = FALSE): void {
     $this->drupalGet('/filter-test-path');
 
     $assert_session = $this->assertSession();
@@ -355,8 +357,10 @@ protected function assertFilterStates($states, $check_size = FALSE) {
    *   An array of workflow IDs to check.
    * @param \Drupal\views\ViewEntityInterface $view
    *   A view configuration object.
+   *
+   * @internal
    */
-  protected function assertWorkflowDependencies(array $workflow_ids, ViewEntityInterface $view) {
+  protected function assertWorkflowDependencies(array $workflow_ids, ViewEntityInterface $view): void {
     $dependencies = $view->getDependencies();
 
     $expected = [];
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateStorageSchemaTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateStorageSchemaTest.php
index 343bfe55b436..c7b84fd6bae6 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateStorageSchemaTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateStorageSchemaTest.php
@@ -124,8 +124,10 @@ public function testUniqueKeys() {
    *   An array of entity values.
    * @param bool $has_exception
    *   If an exception should be triggered when saving the entity.
+   *
+   * @internal
    */
-  protected function assertStorageException(array $values, $has_exception) {
+  protected function assertStorageException(array $values, bool $has_exception): void {
     $defaults = [
       'moderation_state' => 'draft',
       'workflow' => 'editorial',
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
index c238eb3d445c..6c260ef930a3 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
@@ -777,8 +777,10 @@ protected function reloadEntity(EntityInterface $entity, $revision_id = FALSE) {
    * @param bool|null $published
    *   (optional) Whether to check if the entity is published or not. Defaults
    *   to TRUE.
+   *
+   * @internal
    */
-  protected function assertDefaultRevision(EntityInterface $entity, $revision_id, $published = TRUE) {
+  protected function assertDefaultRevision(EntityInterface $entity, int $revision_id, $published = TRUE): void {
     // Get the default revision.
     $entity = $this->reloadEntity($entity);
     $this->assertEquals($revision_id, $entity->getRevisionId());
diff --git a/core/modules/content_moderation/tests/src/Kernel/DefaultRevisionStateTest.php b/core/modules/content_moderation/tests/src/Kernel/DefaultRevisionStateTest.php
index 065973a242cd..307dfc8b2fb5 100644
--- a/core/modules/content_moderation/tests/src/Kernel/DefaultRevisionStateTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/DefaultRevisionStateTest.php
@@ -123,8 +123,10 @@ public function testMultilingual() {
    *   The state the content moderation state revision should be in.
    * @param string $expected_workflow
    *   The workflow the content moderation state revision should be using.
+   *
+   * @internal
    */
-  protected function assertModerationState($revision_id, $langcode, $expected_state, $expected_workflow = 'editorial') {
+  protected function assertModerationState(int $revision_id, string $langcode, string $expected_state, string $expected_workflow = 'editorial'): void {
     $moderation_state_storage = $this->entityTypeManager->getStorage('content_moderation_state');
 
     $query = $moderation_state_storage->getQuery()->accessCheck(FALSE);
diff --git a/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php b/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php
index a59b485d698f..623534e72235 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php
@@ -162,8 +162,10 @@ public function testAssignNullItemList() {
 
   /**
    * Assert the set of expectations when the moderation state field is emptied.
+   *
+   * @internal
    */
-  protected function assertEmptiedModerationFieldItemList() {
+  protected function assertEmptiedModerationFieldItemList(): void {
     $this->assertTrue($this->testNode->moderation_state->isEmpty());
     // Test the empty value causes a violation in the entity.
     $violations = $this->testNode->validate();
diff --git a/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php b/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php
index 800073be049f..c42b798977cd 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php
@@ -321,8 +321,10 @@ public function testStateFilterStatesList() {
    *
    * @param string[] $states
    *   The states which should appear in the filter.
+   *
+   * @internal
    */
-  protected function assertPluginStates($states) {
+  protected function assertPluginStates(array $states): void {
     $plugin = Views::pluginManager('filter')->createInstance('moderation_state_filter', []);
     $view = Views::getView('test_content_moderation_state_filter_base_table');
     $plugin->init($view, $view->getDisplay());
@@ -338,8 +340,10 @@ protected function assertPluginStates($states) {
    *   An array of filters to apply to the view.
    * @param string $view_id
    *   The view to execute for the results.
+   *
+   * @internal
    */
-  protected function assertNodesWithFilters(array $nodes, array $filters, $view_id = 'test_content_moderation_state_filter_base_table') {
+  protected function assertNodesWithFilters(array $nodes, array $filters, string $view_id = 'test_content_moderation_state_filter_base_table'): void {
     $view = Views::getView($view_id);
     $view->setExposedInput($filters);
     $view->execute();
diff --git a/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateSortTest.php b/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateSortTest.php
index 6ddbec3eeddf..b27c4d62eecf 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateSortTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateSortTest.php
@@ -165,8 +165,10 @@ public function testSortRevisionBaseTable() {
    *   The sort order.
    * @param array $expected
    *   The expected results array.
+   *
+   * @internal
    */
-  protected function assertSortResults($view_id, $column, $order, array $expected) {
+  protected function assertSortResults(string $view_id, string $column, string $order, array $expected): void {
     // Test with exposed input.
     $view = Views::getView($view_id);
     $view->setExposedInput([
diff --git a/core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php b/core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php
index 79cf23286c45..ce4730820114 100644
--- a/core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php
@@ -253,7 +253,7 @@ protected function createContentType(array $values = []) {
   /**
    * {@inheritdoc}
    */
-  protected function assertDefaultRevision(EntityInterface $entity, $revision_id, $published = TRUE) {
+  protected function assertDefaultRevision(EntityInterface $entity, int $revision_id, $published = TRUE): void {
     // In the context of a workspace, the default revision ID is always the
     // latest workspace-specific revision, so we need to adjust the expectation
     // of the parent assertion.
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationOutdatedRevisionTranslationTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationOutdatedRevisionTranslationTest.php
index 01e4e9766f5a..07dacff667ba 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationOutdatedRevisionTranslationTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationOutdatedRevisionTranslationTest.php
@@ -85,8 +85,10 @@ public function testFlagAsOutdatedHidden() {
 
   /**
    * Checks whether the flag widget is displayed.
+   *
+   * @internal
    */
-  protected function assertFlagWidget() {
+  protected function assertFlagWidget(): void {
     $this->assertSession()->pageTextNotContains('Flag other translations as outdated');
     $this->assertSession()->pageTextContains('Translations cannot be flagged as outdated when content is moderated.');
   }
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
index 974e396e01e2..de65d5464f7e 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
@@ -253,14 +253,16 @@ public function testAccountLanguageSettingsUI() {
    *
    * @param string $entity_type
    *   The entity type for which to check translatability.
-   * @param string $bundle
+   * @param string|null $bundle
    *   The bundle for which to check translatability.
    * @param bool $enabled
    *   TRUE if translatability should be enabled, FALSE otherwise.
    * @param array $edit
    *   An array of values to submit to the content translation settings page.
+   *
+   * @internal
    */
-  protected function assertSettings($entity_type, $bundle, $enabled, $edit) {
+  protected function assertSettings(string $entity_type, ?string $bundle, bool $enabled, array $edit): void {
     $this->drupalGet('admin/config/regional/content-language');
     $this->submitForm($edit, 'Save configuration');
     $args = ['@entity_type' => $entity_type, '@bundle' => $bundle, '@enabled' => $enabled ? 'enabled' : 'disabled'];
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php
index 9360122fb2bd..6291989f4116 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php
@@ -414,10 +414,12 @@ protected function doTestWorkflows(UserInterface $user, $expected_status) {
 
   /**
    * Assert that the current page does not contain shared form elements.
+   *
+   * @internal
    */
-  protected function assertNoSharedElements() {
+  protected function assertNoSharedElements(): void {
     $language_none = LanguageInterface::LANGCODE_NOT_SPECIFIED;
-    return $this->assertSession()->fieldNotExists("field_test_text[$language_none][0][value]");
+    $this->assertSession()->fieldNotExists("field_test_text[$language_none][0][value]");
   }
 
 }
diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php
index 2c7f8a9a3736..a689935c413f 100644
--- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php
+++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php
@@ -449,8 +449,10 @@ protected function createRevision(ContentEntityInterface $translation, $default
    *
    * @param \Drupal\Core\Entity\EntityConstraintViolationListInterface $violations
    *   A list of violations.
+   *
+   * @internal
    */
-  protected function assertViolations(EntityConstraintViolationListInterface $violations) {
+  protected function assertViolations(EntityConstraintViolationListInterface $violations): void {
     $entity_type_id = $this->storage->getEntityTypeId();
     $settings = $this->contentTranslationManager->getBundleTranslationSettings($entity_type_id, $entity_type_id);
     $message = !empty($settings['untranslatable_fields_hide']) ?
@@ -478,8 +480,10 @@ protected function assertViolations(EntityConstraintViolationListInterface $viol
    *   - target ID (it)
    *   - alt (en)
    *   - alt (it)
+   *
+   * @internal
    */
-  protected function assertLatestRevisionFieldValues($entity_id, array $expected_values) {
+  protected function assertLatestRevisionFieldValues(int $entity_id, array $expected_values): void {
     /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
     $entity = $this->storage->loadRevision($this->storage->getLatestRevisionId($entity_id));
     @[$revision_id, $target_id_en, $target_id_it, $alt_en, $alt_it] = $expected_values;
diff --git a/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php b/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php
index 3f70a6590b77..6f4449880245 100644
--- a/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php
+++ b/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php
@@ -72,8 +72,10 @@ protected function setUp(): void {
    *   The value the migrated entity field should have.
    * @param int $expected_term_reference_tid
    *   The term reference ID the migrated entity field should have.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $expected_language, $expected_label, $expected_vid, $expected_description = '', $expected_format = NULL, $expected_weight = 0, $expected_parents = [], $expected_field_integer_value = NULL, $expected_term_reference_tid = NULL) {
+  protected function assertEntity(int $id, string $expected_language, string $expected_label, string $expected_vid, string $expected_description = '', string $expected_format = NULL, int $expected_weight = 0, array $expected_parents = [], int $expected_field_integer_value = NULL, int $expected_term_reference_tid = NULL): void {
     /** @var \Drupal\taxonomy\TermInterface $entity */
     $entity = Term::load($id);
     $this->assertInstanceOf(TermInterface::class, $entity);
@@ -82,7 +84,7 @@ protected function assertEntity($id, $expected_language, $expected_label, $expec
     $this->assertSame($expected_vid, $entity->bundle());
     $this->assertSame($expected_description, $entity->getDescription());
     $this->assertSame($expected_format, $entity->getFormat());
-    $this->assertSame($expected_weight, $entity->getWeight());
+    $this->assertSame($expected_weight, (int) $entity->getWeight());
     $this->assertHierarchy($expected_vid, $id, $expected_parents);
   }
 
@@ -95,8 +97,10 @@ protected function assertEntity($id, $expected_language, $expected_label, $expec
    *   ID of the term to check.
    * @param array $parent_ids
    *   The expected parent term IDs.
+   *
+   * @internal
    */
-  protected function assertHierarchy($vid, $tid, array $parent_ids) {
+  protected function assertHierarchy(string $vid, int $tid, array $parent_ids): void {
     if (!isset($this->treeData[$vid])) {
       $tree = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree($vid);
       $this->treeData[$vid] = [];
@@ -119,13 +123,13 @@ protected function assertHierarchy($vid, $tid, array $parent_ids) {
    * Tests the Drupal 6 i18n taxonomy term to Drupal 8 migration.
    */
   public function testTranslatedTaxonomyTerms() {
-    $this->assertEntity(1, 'zu', 'zu - term 1 of vocabulary 1', 'vocabulary_1_i_0_', 'zu - description of term 1 of vocabulary 1', NULL, '0', []);
-    $this->assertEntity(2, 'fr', 'fr - term 2 of vocabulary 2', 'vocabulary_2_i_1_', 'fr - description of term 2 of vocabulary 2', NULL, '3', []);
-    $this->assertEntity(3, 'fr', 'fr - term 3 of vocabulary 2', 'vocabulary_2_i_1_', 'fr - description of term 3 of vocabulary 2', NULL, '4', ['2']);
-    $this->assertEntity(4, 'en', 'term 4 of vocabulary 3', 'vocabulary_3_i_2_', 'description of term 4 of vocabulary 3', NULL, '6', []);
-    $this->assertEntity(5, 'en', 'term 5 of vocabulary 3', 'vocabulary_3_i_2_', 'description of term 5 of vocabulary 3', NULL, '7', ['4']);
-    $this->assertEntity(6, 'en', 'term 6 of vocabulary 3', 'vocabulary_3_i_2_', 'description of term 6 of vocabulary 3', NULL, '8', ['4', '5']);
-    $this->assertEntity(7, 'fr', 'fr - term 2 of vocabulary 1', 'vocabulary_1_i_0_', 'fr - desc of term 2 vocab 1', NULL, '0', []);
+    $this->assertEntity(1, 'zu', 'zu - term 1 of vocabulary 1', 'vocabulary_1_i_0_', 'zu - description of term 1 of vocabulary 1', NULL, 0, []);
+    $this->assertEntity(2, 'fr', 'fr - term 2 of vocabulary 2', 'vocabulary_2_i_1_', 'fr - description of term 2 of vocabulary 2', NULL, 3, []);
+    $this->assertEntity(3, 'fr', 'fr - term 3 of vocabulary 2', 'vocabulary_2_i_1_', 'fr - description of term 3 of vocabulary 2', NULL, 4, ['2']);
+    $this->assertEntity(4, 'en', 'term 4 of vocabulary 3', 'vocabulary_3_i_2_', 'description of term 4 of vocabulary 3', NULL, 6, []);
+    $this->assertEntity(5, 'en', 'term 5 of vocabulary 3', 'vocabulary_3_i_2_', 'description of term 5 of vocabulary 3', NULL, 7, ['4']);
+    $this->assertEntity(6, 'en', 'term 6 of vocabulary 3', 'vocabulary_3_i_2_', 'description of term 6 of vocabulary 3', NULL, 8, ['4', '5']);
+    $this->assertEntity(7, 'fr', 'fr - term 2 of vocabulary 1', 'vocabulary_1_i_0_', 'fr - desc of term 2 vocab 1', NULL, 0, []);
   }
 
 }
diff --git a/core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php b/core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php
index 34e3e61b2f80..6e4755b62321 100644
--- a/core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php
+++ b/core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php
@@ -222,8 +222,10 @@ public function testTokenProtection() {
    *
    * @param string $id
    *   A contextual link id.
+   *
+   * @internal
    */
-  protected function assertContextualLinkPlaceHolder($id) {
+  protected function assertContextualLinkPlaceHolder(string $id): void {
     $this->assertSession()->elementAttributeContains(
       'css',
       'div[data-contextual-id="' . $id . '"]',
@@ -237,8 +239,10 @@ protected function assertContextualLinkPlaceHolder($id) {
    *
    * @param string $id
    *   A contextual link id.
+   *
+   * @internal
    */
-  protected function assertNoContextualLinkPlaceHolder($id) {
+  protected function assertNoContextualLinkPlaceHolder(string $id): void {
     $this->assertSession()->elementNotExists('css', 'div[data-contextual-id="' . $id . '"]');
   }
 
diff --git a/core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php b/core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php
index 219b30dc76b9..6cb1b68c3842 100644
--- a/core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php
+++ b/core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php
@@ -100,8 +100,10 @@ protected function pressToolbarEditButton() {
 
   /**
    * Asserts that the correct message was announced when entering edit mode.
+   *
+   * @internal
    */
-  protected function assertAnnounceEditMode() {
+  protected function assertAnnounceEditMode(): void {
     $web_assert = $this->assertSession();
     // Wait for contextual trigger button.
     $web_assert->waitForElementVisible('css', '.contextual trigger');
@@ -111,8 +113,10 @@ protected function assertAnnounceEditMode() {
 
   /**
    * Assert that the correct message was announced when leaving edit mode.
+   *
+   * @internal
    */
-  protected function assertAnnounceLeaveEditMode() {
+  protected function assertAnnounceLeaveEditMode(): void {
     $web_assert = $this->assertSession();
     $page = $this->getSession()->getPage();
     // Wait till all the contextual links are hidden.
diff --git a/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDateonlyTest.php b/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDateonlyTest.php
index 9439f8cf4a23..04e38fd0163e 100644
--- a/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDateonlyTest.php
+++ b/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDateonlyTest.php
@@ -117,7 +117,7 @@ protected function getNormalizedPostEntity() {
   /**
    * {@inheritdoc}
    */
-  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options) {
+  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options): void {
     parent::assertNormalizationEdgeCases($method, $url, $request_options);
 
     if ($this->entity->getEntityType()->hasKey('bundle')) {
diff --git a/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDatetimeTest.php b/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDatetimeTest.php
index f9313f112265..2030900cf421 100644
--- a/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDatetimeTest.php
+++ b/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDatetimeTest.php
@@ -117,7 +117,7 @@ protected function getNormalizedPostEntity() {
   /**
    * {@inheritdoc}
    */
-  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options) {
+  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options): void {
     parent::assertNormalizationEdgeCases($method, $url, $request_options);
 
     if ($this->entity->getEntityType()->hasKey('bundle')) {
diff --git a/core/modules/datetime_range/tests/src/Functional/EntityResource/EntityTest/EntityTestDateRangeTest.php b/core/modules/datetime_range/tests/src/Functional/EntityResource/EntityTest/EntityTestDateRangeTest.php
index 15bc81744593..636221f95117 100644
--- a/core/modules/datetime_range/tests/src/Functional/EntityResource/EntityTest/EntityTestDateRangeTest.php
+++ b/core/modules/datetime_range/tests/src/Functional/EntityResource/EntityTest/EntityTestDateRangeTest.php
@@ -118,7 +118,7 @@ protected function getNormalizedPostEntity() {
   /**
    * {@inheritdoc}
    */
-  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options) {
+  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options): void {
     parent::assertNormalizationEdgeCases($method, $url, $request_options);
 
     if ($this->entity->getEntityType()->hasKey('bundle')) {
diff --git a/core/modules/dblog/tests/src/Functional/DbLogResourceTest.php b/core/modules/dblog/tests/src/Functional/DbLogResourceTest.php
index 12cd954f96a3..4294949ef995 100644
--- a/core/modules/dblog/tests/src/Functional/DbLogResourceTest.php
+++ b/core/modules/dblog/tests/src/Functional/DbLogResourceTest.php
@@ -118,7 +118,7 @@ protected function setUpAuthorization($method) {
   /**
    * {@inheritdoc}
    */
-  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options) {}
+  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options): void {}
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/dblog/tests/src/Functional/DbLogTest.php b/core/modules/dblog/tests/src/Functional/DbLogTest.php
index 4b7ef3c2266f..f83931cf4de1 100644
--- a/core/modules/dblog/tests/src/Functional/DbLogTest.php
+++ b/core/modules/dblog/tests/src/Functional/DbLogTest.php
@@ -819,8 +819,10 @@ protected function getSeverityConstant($class) {
    *   The database log message to check.
    * @param string $message
    *   The message to pass to simpletest.
+   *
+   * @internal
    */
-  protected function assertLogMessage($log_message, $message) {
+  protected function assertLogMessage(string $log_message, string $message): void {
     $message_text = Unicode::truncate($log_message, 56, TRUE, TRUE);
     $this->assertSession()->linkExists($message_text, 0, $message);
   }
diff --git a/core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php b/core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php
index 4196769ac856..e983ea88fd48 100644
--- a/core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php
+++ b/core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php
@@ -214,12 +214,14 @@ protected function uploadImage($uri) {
   /**
    * Asserts whether the saved maximum dimensions equal the ones provided.
    *
-   * @param string $width
+   * @param int|null $width
    *   The expected width of the uploaded image.
-   * @param string $height
+   * @param int|null $height
    *   The expected height of the uploaded image.
+   *
+   * @internal
    */
-  protected function assertSavedMaxDimensions($width, $height) {
+  protected function assertSavedMaxDimensions(?int $width, ?int $height): void {
     $image_upload_settings = Editor::load('basic_html')->getImageUploadSettings();
     $expected = [
       'width' => $image_upload_settings['max_dimensions']['width'],
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php
index a9b551084e8a..22c1d958a50b 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php
@@ -398,8 +398,10 @@ protected function createEntityReferenceField($target_type, $bundles = []) {
    *   The field name.
    * @param array $expected_options
    *   An array of expected options.
+   *
+   * @internal
    */
-  protected function assertFieldSelectOptions($name, array $expected_options) {
+  protected function assertFieldSelectOptions(string $name, array $expected_options): void {
     $options = $this->assertSession()->selectExists($name)->findAll('xpath', 'option');
     array_walk($options, function (NodeElement &$option) {
       $option = $option->getValue();
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
index 58b51dc7e0b7..e69abc86d91c 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
@@ -175,8 +175,10 @@ public function testEntityReferenceDisplay() {
 
   /**
    * Assert entity reference display.
+   *
+   * @internal
    */
-  protected function assertEntityReferenceDisplay() {
+  protected function assertEntityReferenceDisplay(): void {
     $url = $this->referrerEntity->toUrl();
     $translation_url = $this->referrerEntity->toUrl('canonical', ['language' => ConfigurableLanguage::load($this->translateToLangcode)]);
 
@@ -192,8 +194,10 @@ protected function assertEntityReferenceDisplay() {
 
   /**
    * Assert entity reference form display.
+   *
+   * @internal
    */
-  protected function assertEntityReferenceFormDisplay() {
+  protected function assertEntityReferenceFormDisplay(): void {
     $this->drupalLogin($this->webUser);
     $url = $this->referrerEntity->toUrl('edit-form');
     $translation_url = $this->referrerEntity->toUrl('edit-form', ['language' => ConfigurableLanguage::load($this->translateToLangcode)]);
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
index dd6f8d5900f9..bf0ebc2b6d6d 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
@@ -196,8 +196,10 @@ public function testSupportedEntityTypesAndWidgets() {
    *   The name of the test entity.
    * @param \Drupal\Core\Entity\EntityInterface[] $referenced_entities
    *   An array of referenced entities.
+   *
+   * @internal
    */
-  protected function assertFieldValues($entity_name, $referenced_entities) {
+  protected function assertFieldValues(string $entity_name, array $referenced_entities): void {
     $entity = current($this->container->get('entity_type.manager')->getStorage(
     $this->entityType)->loadByProperties(['name' => $entity_name]));
 
diff --git a/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php
index 595aba8e22c8..98253c179f95 100644
--- a/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php
+++ b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
+use Drupal\field\FieldConfigInterface;
 use Drupal\Tests\BrowserTestBase;
 
 /**
@@ -426,8 +427,10 @@ public function testCreateNumberDecimalField() {
 
   /**
    * Helper function to set the minimum value of a field.
+   *
+   * @internal
    */
-  public function assertSetMinimumValue($field, $minimum_value) {
+  public function assertSetMinimumValue(FieldConfigInterface $field, int $minimum_value): void {
     $field_configuration_url = 'entity_test/structure/entity_test/fields/entity_test.entity_test.' . $field->getName();
 
     // Set the minimum value.
diff --git a/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php
index 3273c7a15321..f19f4ed37c41 100644
--- a/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php
+++ b/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php
@@ -352,8 +352,10 @@ public function testFieldAdminHandler() {
    *   The field name.
    * @param array $expected_options
    *   An array of expected options.
+   *
+   * @internal
    */
-  protected function assertFieldSelectOptions($name, array $expected_options) {
+  protected function assertFieldSelectOptions(string $name, array $expected_options): void {
     $field = $this->assertSession()->selectExists($name);
     $options = $field->findAll('xpath', 'option');
     $optgroups = $field->findAll('xpath', 'optgroup');
diff --git a/core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php b/core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php
index 58c1594ef65f..2e0b3a102340 100644
--- a/core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php
+++ b/core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php
@@ -150,8 +150,10 @@ public function testAnchorTagStripping() {
    *
    * @param array $result
    *   Query results keyed by node type and nid.
+   *
+   * @internal
    */
-  protected function assertResults(array $result) {
+  protected function assertResults(array $result): void {
     foreach ($result as $node_type => $values) {
       foreach ($values as $nid => $label) {
         $this->assertSame($node_type, $this->nodes[$nid]->bundle());
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldFormatterSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldFormatterSettingsTest.php
index b78961183c80..83fac6e47f23 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldFormatterSettingsTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldFormatterSettingsTest.php
@@ -34,8 +34,10 @@ protected function setUp(): void {
    *   The display ID.
    * @param string $component_id
    *   The component ID.
+   *
+   * @internal
    */
-  protected function assertComponentNotExists($display_id, $component_id) {
+  protected function assertComponentNotExists(string $display_id, string $component_id): void {
     $component = EntityViewDisplay::load($display_id)->getComponent($component_id);
     $this->assertNull($component);
   }
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php
index 162039c390df..3df1b43de0b9 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php
@@ -43,8 +43,10 @@ protected function setUp(): void {
    *
    * @param string $id
    *   The view display ID.
+   *
+   * @internal
    */
-  protected function assertEntity($id) {
+  protected function assertEntity(string $id): void {
     $display = EntityViewDisplay::load($id);
     $this->assertInstanceOf(EntityViewDisplayInterface::class, $display);
   }
@@ -62,8 +64,10 @@ protected function assertEntity($id) {
    *   The expected label of the component.
    * @param int $weight
    *   The expected weight of the component.
+   *
+   * @internal
    */
-  protected function assertComponent($display_id, $component_id, $type, $label, $weight) {
+  protected function assertComponent(string $display_id, string $component_id, string $type, string $label, int $weight): void {
     $component = EntityViewDisplay::load($display_id)->getComponent($component_id);
     $this->assertIsArray($component);
     $this->assertSame($type, $component['type']);
@@ -78,8 +82,10 @@ protected function assertComponent($display_id, $component_id, $type, $label, $w
    *   The display ID.
    * @param string $component_id
    *   The component ID.
+   *
+   * @internal
    */
-  protected function assertComponentNotExists($display_id, $component_id) {
+  protected function assertComponentNotExists(string $display_id, string $component_id): void {
     $component = EntityViewDisplay::load($display_id)->getComponent($component_id);
     $this->assertNull($component);
   }
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
index 31264bcde6bf..8679f83f6dcc 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
@@ -50,8 +50,10 @@ protected function setUp(): void {
    *   Whether or not the field is required.
    * @param bool $expected_translatable
    *   Whether or not the field is expected to be translatable.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $expected_label, $expected_field_type, $is_required, $expected_translatable) {
+  protected function assertEntity(string $id, string $expected_label, string $expected_field_type, bool $is_required, bool $expected_translatable): void {
     [$expected_entity_type, $expected_bundle, $expected_name] = explode('.', $id);
 
     /** @var \Drupal\field\FieldConfigInterface $field */
@@ -70,12 +72,14 @@ protected function assertEntity($id, $expected_label, $expected_field_type, $is_
   /**
    * Asserts the settings of a link field config entity.
    *
-   * @param $id
+   * @param string $id
    *   The entity ID in the form ENTITY_TYPE.BUNDLE.FIELD_NAME.
-   * @param $title_setting
+   * @param int $title_setting
    *   The expected title setting.
+   *
+   * @internal
    */
-  protected function assertLinkFields($id, $title_setting) {
+  protected function assertLinkFields(string $id, int $title_setting): void {
     $field = FieldConfig::load($id);
     $this->assertSame($title_setting, $field->getSetting('title'));
   }
@@ -87,8 +91,10 @@ protected function assertLinkFields($id, $title_setting) {
    *   The entity ID in the form ENTITY_TYPE.BUNDLE.FIELD_NAME.
    * @param string[] $target_bundles
    *   An array of expected target bundles.
+   *
+   * @internal
    */
-  protected function assertEntityReferenceFields($id, array $target_bundles) {
+  protected function assertEntityReferenceFields(string $id, array $target_bundles): void {
     $field = FieldConfig::load($id);
     $handler_settings = $field->getSetting('handler_settings');
     $this->assertArrayHasKey('target_bundles', $handler_settings);
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php
index f04f1e5c0297..bf0226773134 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php
@@ -49,8 +49,10 @@ protected function setUp(): void {
    *   The expected entity type to which the display settings are attached.
    * @param string $expected_bundle
    *   The expected bundle to which the display settings are attached.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $expected_entity_type, $expected_bundle) {
+  protected function assertEntity(string $id, string $expected_entity_type, string $expected_bundle): void {
     /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $entity */
     $entity = EntityFormDisplay::load($id);
     $this->assertInstanceOf(EntityFormDisplayInterface::class, $entity);
@@ -67,10 +69,12 @@ protected function assertEntity($id, $expected_entity_type, $expected_bundle) {
    *   The component ID.
    * @param string $widget_type
    *   The expected widget type.
-   * @param string $weight
+   * @param int $weight
    *   The expected weight of the component.
+   *
+   * @internal
    */
-  protected function assertComponent($display_id, $component_id, $widget_type, $weight) {
+  protected function assertComponent(string $display_id, string $component_id, string $widget_type, int $weight): void {
     $component = EntityFormDisplay::load($display_id)->getComponent($component_id);
     $this->assertIsArray($component);
     $this->assertSame($widget_type, $component['type']);
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php
index a08996a480ea..cdc96c455bc0 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php
@@ -42,8 +42,10 @@ class MigrateFieldTest extends MigrateDrupal7TestBase {
    *   Whether or not the field is expected to be translatable.
    * @param int $expected_cardinality
    *   The expected cardinality of the field.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $expected_type, $expected_translatable, $expected_cardinality) {
+  protected function assertEntity(string $id, string $expected_type, bool $expected_translatable, int $expected_cardinality): void {
     [$expected_entity_type, $expected_name] = explode('.', $id);
 
     /** @var \Drupal\field\FieldStorageConfigInterface $field */
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php
index 4bdd5f5897c1..1e7229481574 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php
@@ -34,8 +34,10 @@ protected function setUp(): void {
    *   The expected label of the view mode.
    * @param string $entity_type
    *   The expected entity type ID which owns the view mode.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $label, $entity_type) {
+  protected function assertEntity(string $id, string $label, string $entity_type): void {
     /** @var \Drupal\Core\Entity\EntityViewModeInterface $view_mode */
     $view_mode = EntityViewMode::load($id);
     $this->assertInstanceOf(EntityViewModeInterface::class, $view_mode);
diff --git a/core/modules/field/tests/src/Unit/FieldStorageConfigAccessControlHandlerTest.php b/core/modules/field/tests/src/Unit/FieldStorageConfigAccessControlHandlerTest.php
index f613d08cd18b..fc94687a725d 100644
--- a/core/modules/field/tests/src/Unit/FieldStorageConfigAccessControlHandlerTest.php
+++ b/core/modules/field/tests/src/Unit/FieldStorageConfigAccessControlHandlerTest.php
@@ -164,8 +164,10 @@ protected function setUp(): void {
    *   A list of allowed operations.
    * @param \Drupal\Core\Session\AccountInterface $user
    *   The account to use for get access.
+   *
+   * @internal
    */
-  public function assertAllowOperations(array $allow_operations, AccountInterface $user) {
+  public function assertAllowOperations(array $allow_operations, AccountInterface $user): void {
     foreach (['view', 'update', 'delete'] as $operation) {
       $expected = in_array($operation, $allow_operations);
       $actual = $this->accessControlHandler->access($this->entity, $operation, $user);
diff --git a/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php b/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php
index 7ad41defd3c1..467114bc7254 100644
--- a/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php
+++ b/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php
@@ -306,8 +306,10 @@ protected function getRegionTitles() {
    *   The field selector, one of field id|name|label|value.
    * @param string $region_name
    *   The machine name of the region.
+   *
+   * @internal
    */
-  protected function assertFieldInRegion($field_selector, $region_name) {
+  protected function assertFieldInRegion(string $field_selector, string $region_name): void {
     $region_element = $this->getSession()->getPage()->find('css', ".layout__region--$region_name");
     $this->assertNotNull($region_element);
     $this->assertSession()->fieldExists($field_selector, $region_element);
diff --git a/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php b/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php
index 0042c7b0585a..3232d45ce829 100644
--- a/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php
+++ b/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php
@@ -175,14 +175,16 @@ public function testPreSave() {
   /**
    * Asserts than an entity has the correct values.
    *
-   * @param mixed $expected
+   * @param array $expected
    *   The expected values.
    * @param array $values
    *   The actual values.
    * @param string $message
    *   (optional) An error message.
+   *
+   * @internal
    */
-  public static function assertEntityValues($expected, array $values, $message = '') {
+  public static function assertEntityValues(array $expected, array $values, string $message = ''): void {
 
     static::assertArrayHasKey('uuid', $values);
     unset($values['uuid']);
diff --git a/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php b/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php
index 5c073ae73900..ea72a387a13b 100644
--- a/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php
+++ b/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php
@@ -108,8 +108,10 @@ public function testFieldUIRoutes() {
 
   /**
    * Asserts that local tasks exists.
+   *
+   * @internal
    */
-  public function assertLocalTasks() {
+  public function assertLocalTasks(): void {
     $this->assertSession()->linkExists('Settings');
     $this->assertSession()->linkExists('Manage fields');
     $this->assertSession()->linkExists('Manage display');
diff --git a/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
index d0cbe7fba862..864733e8b399 100644
--- a/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
@@ -220,18 +220,17 @@ public function testNoFieldsDisplayOverview() {
    *
    * @param \Drupal\Core\Entity\EntityInterface $node
    *   The node.
-   * @param $view_mode
+   * @param string $view_mode
    *   The view mode in which the node should be displayed.
-   * @param $text
+   * @param string $text
    *   Plain text to look for.
-   * @param $message
+   * @param string $message
    *   Message to display.
    *
-   * @return
-   *   TRUE on pass, FALSE on fail.
+   * @internal
    */
-  public function assertNodeViewText(EntityInterface $node, $view_mode, $text, $message) {
-    return $this->assertNodeViewTextHelper($node, $view_mode, $text, $message, FALSE);
+  public function assertNodeViewText(EntityInterface $node, string $view_mode, string $text, string $message): void {
+    $this->assertNodeViewTextHelper($node, $view_mode, $text, $message, FALSE);
   }
 
   /**
@@ -239,18 +238,17 @@ public function assertNodeViewText(EntityInterface $node, $view_mode, $text, $me
    *
    * @param \Drupal\Core\Entity\EntityInterface $node
    *   The node.
-   * @param $view_mode
+   * @param string $view_mode
    *   The view mode in which the node should be displayed.
-   * @param $text
+   * @param string $text
    *   Plain text to look for.
-   * @param $message
+   * @param string $message
    *   Message to display.
    *
-   * @return
-   *   TRUE on pass, FALSE on fail.
+   * @internal
    */
-  public function assertNodeViewNoText(EntityInterface $node, $view_mode, $text, $message) {
-    return $this->assertNodeViewTextHelper($node, $view_mode, $text, $message, TRUE);
+  public function assertNodeViewNoText(EntityInterface $node, string $view_mode, string $text, string $message): void {
+    $this->assertNodeViewTextHelper($node, $view_mode, $text, $message, TRUE);
   }
 
   /**
@@ -261,16 +259,18 @@ public function assertNodeViewNoText(EntityInterface $node, $view_mode, $text, $
    *
    * @param \Drupal\Core\Entity\EntityInterface $node
    *   The node.
-   * @param $view_mode
+   * @param string $view_mode
    *   The view mode in which the node should be displayed.
-   * @param $text
+   * @param string $text
    *   Plain text to look for.
-   * @param $message
+   * @param string $message
    *   Message to display.
-   * @param $not_exists
+   * @param bool $not_exists
    *   TRUE if this text should not exist, FALSE if it should.
+   *
+   * @internal
    */
-  public function assertNodeViewTextHelper(EntityInterface $node, $view_mode, $text, $message, $not_exists) {
+  public function assertNodeViewTextHelper(EntityInterface $node, string $view_mode, string $text, string $message, bool $not_exists): void {
     // Make sure caches on the tester side are refreshed after changes
     // submitted on the tested side.
     \Drupal::service('entity_field.manager')->clearCachedFieldDefinitions();
@@ -297,8 +297,10 @@ public function assertNodeViewTextHelper(EntityInterface $node, $view_mode, $tex
    *   The field name.
    * @param array $expected_options
    *   An array of expected options.
+   *
+   * @internal
    */
-  protected function assertFieldSelectOptions($name, array $expected_options) {
+  protected function assertFieldSelectOptions(string $name, array $expected_options): void {
     $xpath = $this->assertSession()->buildXPathQuery('//select[@name=:name]', [':name' => $name]);
     $fields = $this->xpath($xpath);
     if ($fields) {
diff --git a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
index 1d54d2847135..1cc2b5adb848 100644
--- a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
@@ -439,16 +439,18 @@ protected function addPersistentFieldStorage() {
   /**
    * Asserts field settings are as expected.
    *
-   * @param $bundle
+   * @param string $bundle
    *   The bundle name for the field.
-   * @param $field_name
+   * @param string $field_name
    *   The field name for the field.
-   * @param $string
+   * @param string $string
    *   The settings text.
-   * @param $entity_type
+   * @param string $entity_type
    *   The entity type for the field.
+   *
+   * @internal
    */
-  public function assertFieldSettings($bundle, $field_name, $string = 'dummy test string', $entity_type = 'node') {
+  public function assertFieldSettings(string $bundle, string $field_name, string $string = 'dummy test string', string $entity_type = 'node'): void {
     // Assert field storage settings.
     $field_storage = FieldStorageConfig::loadByName($entity_type, $field_name);
     $this->assertSame($string, $field_storage->getSetting('test_field_storage_setting'), 'Field storage settings were found.');
diff --git a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php
index c0ee1aff261e..97489fb8fcbf 100644
--- a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php
+++ b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\field_ui\FunctionalJavascript;
 
+use Behat\Mink\Element\NodeElement;
 use Drupal\Core\Entity\Entity\EntityFormDisplay;
 use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
 
@@ -387,10 +388,12 @@ public function testWidgetUI() {
    *   The select field to validate.
    * @param array $expected_options
    *   An array of expected options.
-   * @param null $selected
+   * @param string|null $selected
    *   The default value to validate.
+   *
+   * @internal
    */
-  protected function assertFieldSelectOptions($field, array $expected_options, $selected = NULL) {
+  protected function assertFieldSelectOptions(NodeElement $field, array $expected_options, ?string $selected = NULL): void {
     /** @var \Behat\Mink\Element\NodeElement[] $select_options */
     $select_options = $field->findAll('xpath', 'option');
 
diff --git a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
index 84ad60cd3c0b..358c1f04e15b 100644
--- a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
@@ -649,11 +649,10 @@ public function testComponentDependencies() {
    * @param \Drupal\Core\Entity\Display\EntityDisplayInterface $display
    *   The entity display object to get dependencies from.
    *
-   * @return bool
-   *   TRUE if the assertion succeeded, FALSE otherwise.
+   * @internal
    */
-  protected function assertDependency($type, $key, EntityDisplayInterface $display) {
-    return $this->assertDependencyHelper(TRUE, $type, $key, $display);
+  protected function assertDependency(string $type, string $key, EntityDisplayInterface $display): void {
+    $this->assertDependencyHelper(TRUE, $type, $key, $display);
   }
 
   /**
@@ -666,11 +665,10 @@ protected function assertDependency($type, $key, EntityDisplayInterface $display
    * @param \Drupal\Core\Entity\Display\EntityDisplayInterface $display
    *   The entity display object to get dependencies from.
    *
-   * @return bool
-   *   TRUE if the assertion succeeded, FALSE otherwise.
+   * @internal
    */
-  protected function assertNoDependency($type, $key, EntityDisplayInterface $display) {
-    return $this->assertDependencyHelper(FALSE, $type, $key, $display);
+  protected function assertNoDependency(string $type, string $key, EntityDisplayInterface $display): void {
+    $this->assertDependencyHelper(FALSE, $type, $key, $display);
   }
 
   /**
@@ -685,10 +683,9 @@ protected function assertNoDependency($type, $key, EntityDisplayInterface $displ
    * @param \Drupal\Core\Entity\Display\EntityDisplayInterface $display
    *   The entity display object to get dependencies from.
    *
-   * @return bool
-   *   TRUE if the assertion succeeded.
+   * @internal
    */
-  protected function assertDependencyHelper($assertion, $type, $key, EntityDisplayInterface $display) {
+  protected function assertDependencyHelper(bool $assertion, string $type, string $key, EntityDisplayInterface $display): void {
     $all_dependencies = $display->getDependencies();
     $dependencies = !empty($all_dependencies[$type]) ? $all_dependencies[$type] : [];
     $context = $display instanceof EntityViewDisplayInterface ? 'View' : 'Form';
@@ -696,7 +693,6 @@ protected function assertDependencyHelper($assertion, $type, $key, EntityDisplay
     $args = ['@context' => $context, '@id' => $display->id(), '@type' => $type, '@key' => $key];
     $message = $assertion ? new FormattableMarkup("@context display '@id' depends on @type '@key'.", $args) : new FormattableMarkup("@context display '@id' do not depend on @type '@key'.", $args);
     $this->assertTrue($value, $message);
-    return TRUE;
   }
 
 }
diff --git a/core/modules/file/tests/src/Functional/FileFieldPathTest.php b/core/modules/file/tests/src/Functional/FileFieldPathTest.php
index f89e9982b8bd..4a139ab7da51 100644
--- a/core/modules/file/tests/src/Functional/FileFieldPathTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldPathTest.php
@@ -85,8 +85,10 @@ public function testUploadPath() {
    *   Where the file was actually uploaded.
    * @param string $message
    *   The message to display with this assertion.
+   *
+   * @internal
    */
-  public function assertPathMatch($expected_path, $actual_path, $message) {
+  public function assertPathMatch(string $expected_path, string $actual_path, string $message): void {
     // Strip off the extension of the expected path to allow for _0, _1, etc.
     // suffixes when the file hits a duplicate name.
     $pos = strrpos($expected_path, '.');
diff --git a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php
index 29f4914fa766..9141f031a706 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php
@@ -49,26 +49,28 @@ protected function setUp(): void {
    *   The expected MIME type.
    * @param int $uid
    *   The expected file owner ID.
+   *
+   * @internal
    */
-  protected function assertEntity($fid, $name, $size, $uri, $type, $uid) {
+  protected function assertEntity(int $fid, string $name, int $size, string $uri, string $type, int $uid): void {
     /** @var \Drupal\file\FileInterface $file */
     $file = File::load($fid);
     $this->assertInstanceOf(FileInterface::class, $file);
     $this->assertSame($name, $file->getFilename());
-    $this->assertSame($size, $file->getSize());
+    $this->assertSame($size, (int) $file->getSize());
     $this->assertSame($uri, $file->getFileUri());
     $this->assertSame($type, $file->getMimeType());
-    $this->assertSame($uid, $file->getOwnerId());
+    $this->assertSame($uid, (int) $file->getOwnerId());
   }
 
   /**
    * Tests the Drupal 6 files to Drupal 8 migration.
    */
   public function testFiles() {
-    $this->assertEntity(1, 'Image1.png', '39325', 'public://image-1.png', 'image/png', '1');
-    $this->assertEntity(2, 'Image2.jpg', '1831', 'public://image-2.jpg', 'image/jpeg', '1');
-    $this->assertEntity(3, 'image-3.jpg', '1831', 'public://image-3.jpg', 'image/jpeg', '1');
-    $this->assertEntity(4, 'html-1.txt', '24', 'public://html-1.txt', 'text/plain', '1');
+    $this->assertEntity(1, 'Image1.png', 39325, 'public://image-1.png', 'image/png', 1);
+    $this->assertEntity(2, 'Image2.jpg', 1831, 'public://image-2.jpg', 'image/jpeg', 1);
+    $this->assertEntity(3, 'image-3.jpg', 1831, 'public://image-3.jpg', 'image/jpeg', 1);
+    $this->assertEntity(4, 'html-1.txt', 24, 'public://html-1.txt', 'text/plain', 1);
     // Ensure temporary file was not migrated.
     $this->assertNull(File::load(6));
 
diff --git a/core/modules/filter/tests/src/Functional/FilterFormTest.php b/core/modules/filter/tests/src/Functional/FilterFormTest.php
index e7f9247e0680..bfe9f2bb631d 100644
--- a/core/modules/filter/tests/src/Functional/FilterFormTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterFormTest.php
@@ -175,8 +175,10 @@ protected function doFilterFormTestAsNonAdmin() {
    *
    * @param string $id
    *   The HTML ID of the select element.
+   *
+   * @internal
    */
-  protected function assertNoSelect($id) {
+  protected function assertNoSelect(string $id): void {
     $this->assertSession()->elementNotExists('xpath', "//select[@id=$id]");
   }
 
@@ -190,10 +192,9 @@ protected function assertNoSelect($id) {
    * @param string $selected
    *   The value of the selected option.
    *
-   * @return bool
-   *   TRUE if the assertion passed; FALSE otherwise.
+   * @internal
    */
-  protected function assertOptions($id, array $expected_options, $selected) {
+  protected function assertOptions(string $id, array $expected_options, string $selected): void {
     $select = $this->assertSession()->selectExists($id);
     $found_options = $select->findAll('css', 'option');
     $found_options = array_map(function ($item) {
@@ -212,10 +213,9 @@ protected function assertOptions($id, array $expected_options, $selected) {
    *   An array of option values that are contained in the select element
    *   besides the "- Select -" option.
    *
-   * @return bool
-   *   TRUE if the assertion passed; FALSE otherwise.
+   * @internal
    */
-  protected function assertRequiredSelectAndOptions($id, array $options) {
+  protected function assertRequiredSelectAndOptions(string $id, array $options): void {
     $select = $this->assertSession()->selectExists($id);
     $this->assertSame('required', $select->getAttribute('required'));
     // A required select element has a "- Select -" option whose key is an empty
@@ -230,10 +230,9 @@ protected function assertRequiredSelectAndOptions($id, array $options) {
    * @param string $id
    *   The HTML ID of the textarea.
    *
-   * @return bool
-   *   TRUE if the assertion passed; FALSE otherwise.
+   * @internal
    */
-  protected function assertEnabledTextarea($id) {
+  protected function assertEnabledTextarea(string $id): void {
     $textarea = $this->assertSession()->fieldEnabled($id);
     $this->assertSame('textarea', $textarea->getTagName());
   }
@@ -244,10 +243,9 @@ protected function assertEnabledTextarea($id) {
    * @param string $id
    *   The HTML ID of the textarea.
    *
-   * @return bool
-   *   TRUE if the assertion passed; FALSE otherwise.
+   * @internal
    */
-  protected function assertDisabledTextarea($id) {
+  protected function assertDisabledTextarea(string $id): void {
     $textarea = $this->assertSession()->fieldDisabled($id);
     $this->assertSame('textarea', $textarea->getTagName());
     $this->assertSame('This field has been disabled because you do not have sufficient permissions to edit it.', $textarea->getText());
diff --git a/core/modules/filter/tests/src/Kernel/FilterAPITest.php b/core/modules/filter/tests/src/Kernel/FilterAPITest.php
index 76255f6f7ebd..34a2ed13f406 100644
--- a/core/modules/filter/tests/src/Kernel/FilterAPITest.php
+++ b/core/modules/filter/tests/src/Kernel/FilterAPITest.php
@@ -430,10 +430,12 @@ public function testFilterFormatPreSave() {
    *
    * @param \Symfony\Component\Validator\ConstraintViolationListInterface $violations
    *   The violations to assert.
-   * @param mixed $invalid_value
+   * @param string $invalid_value
    *   The expected invalid value.
+   *
+   * @internal
    */
-  public function assertFilterFormatViolation(ConstraintViolationListInterface $violations, $invalid_value) {
+  public function assertFilterFormatViolation(ConstraintViolationListInterface $violations, string $invalid_value): void {
     $filter_format_violation_found = FALSE;
     foreach ($violations as $violation) {
       if ($violation->getRoot() instanceof FilterFormatDataType && $violation->getInvalidValue() === $invalid_value) {
diff --git a/core/modules/filter/tests/src/Kernel/FilterKernelTest.php b/core/modules/filter/tests/src/Kernel/FilterKernelTest.php
index f51f86a6710d..c7f9b5fadfb8 100644
--- a/core/modules/filter/tests/src/Kernel/FilterKernelTest.php
+++ b/core/modules/filter/tests/src/Kernel/FilterKernelTest.php
@@ -9,6 +9,7 @@
 use Drupal\editor\EditorXssFilter\Standard;
 use Drupal\filter\Entity\FilterFormat;
 use Drupal\filter\FilterPluginCollection;
+use Drupal\filter\Plugin\FilterInterface;
 use Drupal\KernelTests\KernelTestBase;
 
 /**
@@ -860,7 +861,7 @@ public function testUrlFilter() {
   /**
    * Asserts multiple filter output expectations for multiple input strings.
    *
-   * @param FilterInterface $filter
+   * @param \Drupal\filter\Plugin\FilterInterface $filter
    *   An input filter object.
    * @param array $tests
    *   An associative array, whereas each key is an arbitrary input string and
@@ -875,8 +876,10 @@ public function testUrlFilter() {
    *     ),
    *   );
    *   @endcode
+   *
+   * @internal
    */
-  public function assertFilteredString($filter, $tests) {
+  public function assertFilteredString(FilterInterface $filter, array $tests): void {
     foreach ($tests as $source => $tasks) {
       $result = $filter->process($source, $filter)->getProcessedText();
       foreach ($tasks as $value => $is_expected) {
@@ -1141,8 +1144,10 @@ public function testHtmlCorrectorFilter() {
    *   (optional) Message to display if failed. Defaults to an empty string.
    * @param string $group
    *   (optional) The group this message belongs to. Defaults to 'Other'.
+   *
+   * @internal
    */
-  public function assertNormalized($haystack, $needle, $message = '', $group = 'Other') {
+  public function assertNormalized(string $haystack, string $needle, string $message = '', string $group = 'Other'): void {
     $this->assertStringContainsString($needle, strtolower(Html::decodeEntities($haystack)), $message);
   }
 
@@ -1163,8 +1168,10 @@ public function assertNormalized($haystack, $needle, $message = '', $group = 'Ot
    *   (optional) Message to display if failed. Defaults to an empty string.
    * @param string $group
    *   (optional) The group this message belongs to. Defaults to 'Other'.
+   *
+   * @internal
    */
-  public function assertNoNormalized($haystack, $needle, $message = '', $group = 'Other') {
+  public function assertNoNormalized(string $haystack, string $needle, string $message = '', string $group = 'Other'): void {
     $this->assertStringNotContainsString($needle, strtolower(Html::decodeEntities($haystack)), $message);
   }
 
diff --git a/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterFormatTest.php b/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterFormatTest.php
index c32885eae14b..72fd8dcd6213 100644
--- a/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterFormatTest.php
+++ b/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterFormatTest.php
@@ -67,8 +67,10 @@ public static function migrateDumpAlter(KernelTestBase $test) {
    *   The weight of the filter.
    * @param bool $status
    *   The status of the filter.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $label, array $enabled_filters, $weight, $status) {
+  protected function assertEntity(string $id, string $label, array $enabled_filters, int $weight, bool $status): void {
     /** @var \Drupal\filter\FilterFormatInterface $entity */
     $entity = FilterFormat::load($id);
     $this->assertInstanceOf(FilterFormatInterface::class, $entity);
diff --git a/core/modules/help_topics/tests/src/Functional/HelpTopicSearchTest.php b/core/modules/help_topics/tests/src/Functional/HelpTopicSearchTest.php
index 84e34b3af4fe..4aac99d5bd07 100644
--- a/core/modules/help_topics/tests/src/Functional/HelpTopicSearchTest.php
+++ b/core/modules/help_topics/tests/src/Functional/HelpTopicSearchTest.php
@@ -290,8 +290,10 @@ public function testUninstallSearch() {
    *
    * @param int $count
    *   The expected number of search results.
+   *
+   * @internal
    */
-  protected function assertSearchResultsCount($count) {
+  protected function assertSearchResultsCount(int $count): void {
     $this->assertSession()->elementsCount('css', '.help_search-results > li', $count);
   }
 
diff --git a/core/modules/image/tests/src/Kernel/ImageFormatterTest.php b/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
index da0e59845fe4..0def1eea4163 100644
--- a/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
+++ b/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
@@ -206,8 +206,10 @@ public function testImageFormatterUrlOptions() {
    *   The renderable array. Must have a #cache[tags] element.
    * @param array $cache_tags
    *   The expected cache tags.
+   *
+   * @internal
    */
-  protected function assertCacheTags(array $renderable, array $cache_tags) {
+  protected function assertCacheTags(array $renderable, array $cache_tags): void {
     $diff = array_diff($cache_tags, $renderable['#cache']['tags']);
     $this->assertEmpty($diff);
   }
diff --git a/core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageCacheTest.php b/core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageCacheTest.php
index c4e3d5d46c41..89009fd05886 100644
--- a/core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageCacheTest.php
+++ b/core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageCacheTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Database\Database;
 use Drupal\image\Entity\ImageStyle;
+use Drupal\image\ImageEffectPluginCollection;
 use Drupal\migrate\Plugin\MigrationInterface;
 use Drupal\migrate\Exception\RequirementsException;
 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
@@ -141,27 +142,27 @@ public function testInvalidCropValues() {
   /**
    * Assert that a given image effect is migrated.
    *
-   * @param array $collection
+   * @param \Drupal\image\ImageEffectPluginCollection $collection
    *   Collection of effects
-   * @param $id
+   * @param string $id
    *   Id that should exist in the collection.
-   * @param $config
+   * @param array $config
    *   Expected configuration for the collection.
    *
-   * @return bool
+   * @internal
    */
-  protected function assertImageEffect($collection, $id, $config) {
+  protected function assertImageEffect(ImageEffectPluginCollection $collection, string $id, array $config): void {
     /** @var \Drupal\image\ConfigurableImageEffectBase $effect */
     foreach ($collection as $effect) {
       $effect_config = $effect->getConfiguration();
 
       if ($effect_config['id'] == $id && $effect_config['data'] == $config) {
-        // We found this effect so succeed and return.
-        return TRUE;
+        // We found this effect so the assertion is successful.
+        return;
       }
     }
     // The loop did not find the effect so we it was not imported correctly.
-    return $this->fail('Effect ' . $id . ' did not import correctly');
+    $this->fail('Effect ' . $id . ' did not import correctly');
   }
 
 }
diff --git a/core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageStylesTest.php b/core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageStylesTest.php
index 11d2a88e14da..df0f6c7d0433 100644
--- a/core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageStylesTest.php
+++ b/core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageStylesTest.php
@@ -49,7 +49,7 @@ public function testImageStylesMigration() {
    * @param array $expected_effect_config
    *   An array of expected configuration for each effect in the image style
    */
-  protected function assertEntity($id, $label, array $expected_effect_plugins, array $expected_effect_config) {
+  protected function assertEntity(string $id, string $label, array $expected_effect_plugins, array $expected_effect_config): void {
     $style = ImageStyle::load($id);
     $this->assertInstanceOf(ImageStyleInterface::class, $style);
     /** @var \Drupal\image\ImageStyleInterface $style */
diff --git a/core/modules/jsonapi/tests/src/Functional/FileUploadTest.php b/core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
index 5627ae8a4d1e..a44424b61c40 100644
--- a/core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
@@ -910,8 +910,10 @@ protected function setUpAuthorization($method) {
    *   The expected data.
    * @param \Psr\Http\Message\ResponseInterface $response
    *   The file upload response.
+   *
+   * @internal
    */
-  protected function assertResponseData(array $expected, ResponseInterface $response) {
+  protected function assertResponseData(array $expected, ResponseInterface $response): void {
     static::recursiveKSort($expected);
     $actual = Json::decode((string) $response->getBody());
     static::recursiveKSort($actual);
diff --git a/core/modules/jsonapi/tests/src/Functional/NodeTest.php b/core/modules/jsonapi/tests/src/Functional/NodeTest.php
index 3f1418bf4c62..411e0738d6fd 100644
--- a/core/modules/jsonapi/tests/src/Functional/NodeTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/NodeTest.php
@@ -370,8 +370,10 @@ public function testGetIndividual() {
    * Asserts that normalizations are cached in an incremental way.
    *
    * @throws \Drupal\Core\Entity\EntityStorageException
+   *
+   * @internal
    */
-  protected function assertCacheableNormalizations() {
+  protected function assertCacheableNormalizations(): void {
     // Save the entity to invalidate caches.
     $this->entity->save();
     $uuid = $this->entity->uuid();
@@ -407,8 +409,10 @@ protected function assertCacheableNormalizations() {
    *
    * @param string[] $field_names
    *   The field names.
+   *
+   * @internal
    */
-  protected function assertNormalizedFieldsAreCached($field_names) {
+  protected function assertNormalizedFieldsAreCached(array $field_names): void {
     $cache = \Drupal::service('render_cache')->get([
       '#cache' => [
         'keys' => ['node--camelids', $this->entity->uuid()],
diff --git a/core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php b/core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php
index e0a79f3f5611..d58bc02b2f70 100644
--- a/core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php
+++ b/core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php
@@ -112,7 +112,7 @@ public function testApiJsonNotSupportedInRest() {
   /**
    * {@inheritdoc}
    */
-  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options) {}
+  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options): void {}
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/jsonapi/tests/src/Functional/UserTest.php b/core/modules/jsonapi/tests/src/Functional/UserTest.php
index 21a2d99d0b58..365905b28e6e 100644
--- a/core/modules/jsonapi/tests/src/Functional/UserTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/UserTest.php
@@ -315,8 +315,10 @@ public function testPatchDxForSecuritySensitiveBaseFields() {
    *   The username to log in with.
    * @param string $password
    *   The password to log in with.
+   *
+   * @internal
    */
-  protected function assertRpcLogin($username, $password) {
+  protected function assertRpcLogin(string $username, string $password): void {
     $request_body = [
       'name' => $username,
       'pass' => $password,
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentTaxonomyVocabularySettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentTaxonomyVocabularySettingsTest.php
index b7df98402bb3..dc56e20b0543 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentTaxonomyVocabularySettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentTaxonomyVocabularySettingsTest.php
@@ -66,8 +66,10 @@ public function testLanguageContentTaxonomy() {
    *   The expected state of language alterable.
    * @param array $third_party_settings
    *   The content translation setting.
+   *
+   * @internal
    */
-  public function assertLanguageContentSettings($target_entity, $bundle, $default_langcode, $language_alterable, array $third_party_settings) {
+  public function assertLanguageContentSettings(string $target_entity, string $bundle, string $default_langcode, bool $language_alterable, array $third_party_settings): void {
     $config = ContentLanguageSettings::load($target_entity . "." . $bundle);
     $this->assertInstanceOf(ContentLanguageSettings::class, $config);
     $this->assertSame($target_entity, $config->getTargetEntityTypeId());
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageTest.php b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageTest.php
index 57e0728f5957..957b1e986b13 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageTest.php
@@ -28,8 +28,10 @@ class MigrateLanguageTest extends MigrateDrupal6TestBase {
    *   ConfigurableLanguageInterface). Defaults to LTR.
    * @param int $weight
    *   (optional) The weight of the language. Defaults to 0.
+   *
+   * @internal
    */
-  protected function assertLanguage($id, $label, $direction = ConfigurableLanguageInterface::DIRECTION_LTR, $weight = 0) {
+  protected function assertLanguage(string $id, string $label, string $direction = ConfigurableLanguageInterface::DIRECTION_LTR, int $weight = 0): void {
     /** @var \Drupal\language\ConfigurableLanguageInterface $language */
     $language = ConfigurableLanguage::load($id);
     $this->assertInstanceOf(ConfigurableLanguageInterface::class, $language);
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentTaxonomyVocabularySettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentTaxonomyVocabularySettingsTest.php
index 591cb5d9f0e0..2cacadd2394a 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentTaxonomyVocabularySettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentTaxonomyVocabularySettingsTest.php
@@ -67,8 +67,10 @@ public function testLanguageContentTaxonomy() {
    *   The expected state of language alterable.
    * @param array $third_party_settings
    *   The content translation setting.
+   *
+   * @internal
    */
-  public function assertLanguageContentSettings($target_entity, $bundle, $default_langcode, $language_alterable, array $third_party_settings) {
+  public function assertLanguageContentSettings(string $target_entity, string $bundle, string $default_langcode, bool $language_alterable, array $third_party_settings): void {
     $config = ContentLanguageSettings::load($target_entity . '.' . $bundle);
     $this->assertInstanceOf(ContentLanguageSettings::class, $config);
     $this->assertSame($target_entity, $config->getTargetEntityTypeId());
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php
index 2f92dbee69f7..dcf482eb8c3c 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php
@@ -279,7 +279,7 @@ public function providerTestAccessWithoutBundles() {
    * @param bool $expected_access
    *   The expected access.
    */
-  private function assertExpectedAccess($expected_access) {
+  private function assertExpectedAccess(bool $expected_access): void {
     $expected_status_code = $expected_access ? 200 : 403;
     $this->assertSession()->statusCodeEquals($expected_status_code);
   }
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
index 085942a95489..d4314d7ecbb0 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
@@ -1452,8 +1452,10 @@ public function testRemovingSectionWithoutLayoutLabel() {
 
   /**
    * Asserts that the correct layouts are available.
+   *
+   * @internal
    */
-  protected function assertCorrectLayouts() {
+  protected function assertCorrectLayouts(): void {
     $assert_session = $this->assertSession();
     // Ensure the layouts provided by layout_builder are available.
     $expected_layouts_hrefs = [
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php
index 75fd60283905..c22938cb8b87 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php
@@ -293,8 +293,10 @@ public function testLayoutDeletingBundle() {
    *   A string of cache tags to be found in the header.
    * @param string $expected_dynamic_cache
    *   The expected dynamic cache header. Either 'HIT', 'MISS' or 'UNCACHEABLE'.
+   *
+   * @internal
    */
-  protected function assertLayoutSection($expected_selector, $expected_content, $expected_cache_contexts = '', $expected_cache_tags = '', $expected_dynamic_cache = 'MISS') {
+  protected function assertLayoutSection($expected_selector, $expected_content, string $expected_cache_contexts = '', string $expected_cache_tags = '', string $expected_dynamic_cache = 'MISS'): void {
     $assert_session = $this->assertSession();
     // Find the given selector.
     foreach ((array) $expected_selector as $selector) {
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php
index d50e1fa400be..d4402a796583 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php
@@ -149,8 +149,10 @@ protected function filterVisibleElements(array $elements) {
    *
    * @param string $expected_message
    *   The text expected to be present in #drupal-live-announce.
+   *
+   * @internal
    */
-  protected function assertAnnounceContains($expected_message) {
+  protected function assertAnnounceContains(string $expected_message): void {
     $assert_session = $this->assertSession();
     $this->assertNotEmpty($assert_session->waitForElement('css', "#drupal-live-announce:contains('$expected_message')"));
   }
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php
index 82ed4024997b..54e7e4e9b43c 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php
@@ -89,8 +89,10 @@ public function testValidationMessage() {
 
   /**
    * Asserts that the validation messages are shown correctly.
+   *
+   * @internal
    */
-  protected function assertMessagesDisplayed() {
+  protected function assertMessagesDisplayed(): void {
     $assert_session = $this->assertSession();
     $page = $this->getSession()->getPage();
     $messages_locator = '#drupal-off-canvas .messages--error';
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php
index 01b76696c534..0d472adc8219 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php
@@ -123,8 +123,10 @@ public function testContentPreviewToggle() {
 
   /**
    * Checks if contextual links are working properly.
+   *
+   * @internal
    */
-  protected function assertContextualLinks() {
+  protected function assertContextualLinks(): void {
     $page = $this->getSession()->getPage();
     $assert_session = $this->assertSession();
 
@@ -141,8 +143,10 @@ protected function assertContextualLinks() {
    *
    * @param string[] $items
    *   An ordered list of strings that should appear in the blocks.
+   *
+   * @internal
    */
-  protected function assertOrderInPage(array $items) {
+  protected function assertOrderInPage(array $items): void {
     $session = $this->getSession();
     $page = $session->getPage();
     $blocks = $page->findAll('css', '[data-layout-content-preview-placeholder-label]');
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php
index fc73d5f23feb..948723323374 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php
@@ -123,8 +123,10 @@ protected function addBlock($block_name) {
 
   /**
    * Asserts the contextual links are correct in Layout Builder UI.
+   *
+   * @internal
    */
-  protected function assertCorrectContextualLinksInUi() {
+  protected function assertCorrectContextualLinksInUi(): void {
     $assert_session = $this->assertSession();
     $page = $this->getSession()->getPage();
     $this->assertNotEmpty($assert_session->waitForElementVisible('css', '.block-views-blocktest-block-view-block-2'));
@@ -139,8 +141,10 @@ protected function assertCorrectContextualLinksInUi() {
 
   /**
    * Asserts the contextual links are correct on the canonical entity route.
+   *
+   * @internal
    */
-  protected function assertCorrectContextualLinksInNode() {
+  protected function assertCorrectContextualLinksInNode(): void {
     $assert_session = $this->assertSession();
     $page = $this->getSession()->getPage();
 
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php
index 90bd6a5e7788..5727e9b8a403 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php
@@ -97,7 +97,7 @@ public function testPrivateFiles() {
     $this->assertSaveLayout();
 
     $this->drupalGet('node/1');
-    $private_href1 = $this->assertFileAccessibleOnNode($file);
+    $private_href1 = $this->getFileHrefAccessibleOnNode($file);
 
     // Remove the inline block with the private file.
     $this->drupalGet('node/1/layout');
@@ -121,7 +121,7 @@ public function testPrivateFiles() {
     $this->assertSaveLayout();
 
     $this->drupalGet('node/1');
-    $private_href2 = $this->assertFileAccessibleOnNode($file2);
+    $private_href2 = $this->getFileHrefAccessibleOnNode($file2);
 
     $this->createNewNodeRevision(1);
 
@@ -131,7 +131,7 @@ public function testPrivateFiles() {
     $this->assertSaveLayout();
 
     $this->drupalGet('node/1');
-    $private_href3 = $this->assertFileAccessibleOnNode($file3);
+    $private_href3 = $this->getFileHrefAccessibleOnNode($file3);
 
     // $file2 is on a previous revision of the block which is on a previous
     // revision of the node. The user does not have access to view the previous
@@ -154,7 +154,7 @@ public function testPrivateFiles() {
     $this->assertSaveLayout();
 
     $this->drupalGet('node/2');
-    $private_href4 = $this->assertFileAccessibleOnNode($file4);
+    $private_href4 = $this->getFileHrefAccessibleOnNode($file4);
 
     $this->createNewNodeRevision(2);
 
@@ -236,7 +236,7 @@ protected function createPrivateFile($file_name) {
   }
 
   /**
-   * Asserts a file is accessible on the page.
+   * Returns the href of a file, asserting it is accessible on the page.
    *
    * @param \Drupal\file\FileInterface $file
    *   The file entity.
@@ -244,17 +244,16 @@ protected function createPrivateFile($file_name) {
    * @return string
    *   The file href.
    */
-  protected function assertFileAccessibleOnNode(FileInterface $file) {
-    $assert_session = $this->assertSession();
+  protected function getFileHrefAccessibleOnNode(FileInterface $file): string {
     $page = $this->getSession()->getPage();
-    $assert_session->linkExists($file->label());
+    $this->assertSession()->linkExists($file->label());
     $private_href = $page->findLink($file->label())->getAttribute('href');
     $page->clickLink($file->label());
-    $assert_session->pageTextContains($this->getFileSecret($file));
+    $this->assertSession()->pageTextContains($this->getFileSecret($file));
 
     // Access file directly.
     $this->drupalGet($private_href);
-    $assert_session->pageTextContains($this->getFileSecret($file));
+    $this->assertSession()->pageTextContains($this->getFileSecret($file));
     return $private_href;
   }
 
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
index bbcd3cf5127a..773ad3a396a1 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
@@ -316,8 +316,10 @@ public function testInlineBlocksRevisioningIntegrity() {
    *   The revision ID to assert.
    * @param array $content
    *   The content items to assert on the page.
+   *
+   * @internal
    */
-  protected function assertNodeRevisionContent($revision_id, array $content) {
+  protected function assertNodeRevisionContent(int $revision_id, array $content): void {
     $this->drupalGet("node/1/revisions/$revision_id/view");
     foreach ($content as $content_item) {
       $this->assertSession()->pageTextContains($content_item);
@@ -331,8 +333,10 @@ protected function assertNodeRevisionContent($revision_id, array $content) {
    *   The block title.
    * @param int $expected_revision_count
    *   The revision count.
+   *
+   * @internal
    */
-  protected function assertBlockRevisionCountByTitle($block_title, $expected_revision_count) {
+  protected function assertBlockRevisionCountByTitle(string $block_title, int $expected_revision_count): void {
     $actual_revision_count = $this->blockStorage->getQuery()
       ->accessCheck(FALSE)
       ->condition('info', $block_title)
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
index dcdc7be6cc99..e83099c1dbc9 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
@@ -174,8 +174,10 @@ protected function addBlock($block_link_text, $rendered_locator) {
    *
    * @param \Behat\Mink\Element\NodeElement $element
    *   Element being checked for.
+   *
+   * @internal
    */
-  protected function assertElementUnclickable(NodeElement $element) {
+  protected function assertElementUnclickable(NodeElement $element): void {
     try {
       $element->click();
       $tag_name = $element->getTagName();
@@ -188,8 +190,10 @@ protected function assertElementUnclickable(NodeElement $element) {
 
   /**
    * Asserts that forms, links, and iframes in preview are non-interactive.
+   *
+   * @internal
    */
-  protected function assertLinksFormIframeNotInteractive() {
+  protected function assertLinksFormIframeNotInteractive(): void {
     $assert_session = $this->assertSession();
     $page = $this->getSession()->getPage();
 
@@ -204,8 +208,10 @@ protected function assertLinksFormIframeNotInteractive() {
 
   /**
    * Confirms that Layout Builder contextual links remain active.
+   *
+   * @internal
    */
-  protected function assertContextualLinksClickable() {
+  protected function assertContextualLinksClickable(): void {
     $assert_session = $this->assertSession();
     $page = $this->getSession()->getPage();
     $this->drupalGet($this->getUrl());
@@ -233,8 +239,10 @@ protected function assertContextualLinksClickable() {
    * This is confirmed by clicking a contextual link then moving the mouse
    * pointer. If mouseup is working properly, the draggable element will not
    * be moved by the pointer moving.
+   *
+   * @internal
    */
-  protected function assertContextualLinkRetainsMouseup() {
+  protected function assertContextualLinkRetainsMouseup(): void {
     $assert_session = $this->assertSession();
     $page = $this->getSession()->getPage();
     $body_field_selector = '.block-field-blocknodebundle-with-section-fieldbody';
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php
index 1562216da593..35c8b8090c69 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php
@@ -477,7 +477,7 @@ private function openAddBlockForm($block_title) {
    * @param string $expected_form_id
    *   The expected form ID.
    */
-  private function assertOffCanvasFormAfterWait($expected_form_id) {
+  private function assertOffCanvasFormAfterWait(string $expected_form_id): void {
     $this->assertSession()->assertWaitOnAjaxRequest();
     $off_canvas = $this->assertSession()->waitForElementVisible('css', '#drupal-off-canvas');
     $this->assertNotNull($off_canvas);
@@ -503,7 +503,7 @@ private function markCurrentPage() {
    *
    * @todo Remove in https://www.drupal.org/project/drupal/issues/2909782.
    */
-  private function assertPageNotReloaded() {
+  private function assertPageNotReloaded(): void {
     $this->assertSession()->pageTextContains($this->pageReloadMarker);
   }
 
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php
index 6523bd636797..77af692cc51a 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php
@@ -105,8 +105,10 @@ public function testUnsavedChangesMessage() {
    *
    * @param string $path
    *   The path to a Layout Builder UI page.
+   *
+   * @internal
    */
-  protected function assertModifiedLayout($path) {
+  protected function assertModifiedLayout(string $path): void {
     $assert_session = $this->assertSession();
     $page = $this->getSession()->getPage();
 
@@ -267,7 +269,7 @@ public function testNewExtraField() {
    * @param string $selector
    *   The highlighted element must also match this selector.
    */
-  private function assertHighlightedElement($selector) {
+  private function assertHighlightedElement(string $selector): void {
     $assert_session = $this->assertSession();
     $page = $this->getSession()->getPage();
 
@@ -281,7 +283,7 @@ private function assertHighlightedElement($selector) {
   /**
    * Waits for the dialog to close and confirms no highlights are present.
    */
-  private function assertHighlightNotExists() {
+  private function assertHighlightNotExists(): void {
     $assert_session = $this->assertSession();
 
     $assert_session->assertNoElementAfterWait('css', '#drupal-off-canvas');
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php
index 3b857b10e5ba..f7b302e7355b 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php
@@ -142,8 +142,10 @@ public function testMoveBlock() {
    *
    * @param string[] $expected_block_labels
    *   The expected block labels.
+   *
+   * @internal
    */
-  protected function assertBlockTable(array $expected_block_labels) {
+  protected function assertBlockTable(array $expected_block_labels): void {
     $page = $this->getSession()->getPage();
     $this->assertSession()->assertWaitOnAjaxRequest();
     $block_tds = $page->findAll('css', '.layout-builder-components-table__block-label');
@@ -202,8 +204,10 @@ protected function findRowHandle($block_label) {
    *   The region.
    * @param array $expected_block_selectors
    *   The block selectors.
+   *
+   * @internal
    */
-  protected function assertRegionBlocksOrder($section_delta, $region, array $expected_block_selectors) {
+  protected function assertRegionBlocksOrder(int $section_delta, string $region, array $expected_block_selectors): void {
     $page = $this->getSession()->getPage();
     $assert_session = $this->assertSession();
 
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php
index 2fd7cd7a7839..9ec01e7cb0d3 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php
@@ -112,8 +112,10 @@ public function testWidthChange() {
    *
    * @param string $width_class
    *   The width class.
+   *
+   * @internal
    */
-  protected function assertWidthClassApplied($width_class) {
+  protected function assertWidthClassApplied(string $width_class): void {
     $this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', ".{$width_class}[data-layout-delta=\"0\"]"));
   }
 
diff --git a/core/modules/layout_builder/tests/src/Unit/SectionTest.php b/core/modules/layout_builder/tests/src/Unit/SectionTest.php
index 2e21947de9dd..7e3c5b130280 100644
--- a/core/modules/layout_builder/tests/src/Unit/SectionTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/SectionTest.php
@@ -188,8 +188,10 @@ public function testInsertComponentInvalidDelta() {
    *   The expected sections.
    * @param \Drupal\layout_builder\Section $section
    *   The section storage to check.
+   *
+   * @internal
    */
-  protected function assertComponents(array $expected, Section $section) {
+  protected function assertComponents(array $expected, Section $section): void {
     $result = $section->getComponents();
     $this->assertEquals($expected, $result);
     $this->assertSame(array_keys($expected), array_keys($result));
diff --git a/core/modules/link/tests/src/Functional/LinkFieldTest.php b/core/modules/link/tests/src/Functional/LinkFieldTest.php
index 2e4044abfa93..80b03928006a 100644
--- a/core/modules/link/tests/src/Functional/LinkFieldTest.php
+++ b/core/modules/link/tests/src/Functional/LinkFieldTest.php
@@ -211,8 +211,10 @@ public function testURLValidation() {
    *   The field name.
    * @param array $valid_entries
    *   An array of valid URL entries.
+   *
+   * @internal
    */
-  protected function assertValidEntries($field_name, array $valid_entries) {
+  protected function assertValidEntries(string $field_name, array $valid_entries): void {
     foreach ($valid_entries as $uri => $string) {
       $edit = [
         "{$field_name}[0][uri]" => $uri,
@@ -233,8 +235,10 @@ protected function assertValidEntries($field_name, array $valid_entries) {
    *   The field name.
    * @param array $invalid_entries
    *   An array of invalid URL entries.
+   *
+   * @internal
    */
-  protected function assertInvalidEntries($field_name, array $invalid_entries) {
+  protected function assertInvalidEntries(string $field_name, array $invalid_entries): void {
     foreach ($invalid_entries as $invalid_value => $error_message) {
       $edit = [
         "{$field_name}[0][uri]" => $invalid_value,
diff --git a/core/modules/link/tests/src/Functional/LinkFieldUITest.php b/core/modules/link/tests/src/Functional/LinkFieldUITest.php
index 7045a04fa3d7..177fa62a8ac1 100644
--- a/core/modules/link/tests/src/Functional/LinkFieldUITest.php
+++ b/core/modules/link/tests/src/Functional/LinkFieldUITest.php
@@ -218,8 +218,10 @@ public function runFieldUIItem($cardinality, $link_type, $title, $label, $field_
    *   The name of the field to check.
    * @param string $text
    *   The text to check.
+   *
+   * @internal
    */
-  protected function assertFieldContainsRawText($field_name, $text) {
+  protected function assertFieldContainsRawText(string $field_name, string $text): void {
     $this->assertTrue((bool) preg_match('/' . preg_quote($text, '/') . '/ui', $this->getFieldHtml($field_name)));
   }
 
@@ -230,8 +232,10 @@ protected function assertFieldContainsRawText($field_name, $text) {
    *   The name of the field to check.
    * @param string $text
    *   The text to check.
+   *
+   * @internal
    */
-  protected function assertNoFieldContainsRawText($field_name, $text) {
+  protected function assertNoFieldContainsRawText(string $field_name, string $text): void {
     $this->assertFalse((bool) preg_match('/' . preg_quote($text, '/') . '/ui', $this->getFieldHtml($field_name)));
   }
 
diff --git a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
index b9f6f3bababb..886710312b58 100644
--- a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
@@ -247,8 +247,10 @@ public function testOptionalConfiguration() {
    * @param bool $optional
    *   Whether to assume a sample of the optional default configuration is
    *   present.
+   *
+   * @internal
    */
-  protected function assertNodeConfig($required, $optional) {
+  protected function assertNodeConfig(bool $required, bool $optional): void {
     // Check the required default configuration in node module.
     $string = $this->storage->findString(['source' => 'Make content sticky', 'context' => '', 'type' => 'configuration']);
     if ($required) {
diff --git a/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php b/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php
index 9084e1d52979..f059508eed3a 100644
--- a/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php
+++ b/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php
@@ -386,8 +386,10 @@ protected function deleteLocaleTranslationData($config_name, $key, $source_value
    *   The configuration name.
    * @param string $langcode
    *   The language code.
+   *
+   * @internal
    */
-  protected function assertNoConfigOverride($config_name, $langcode) {
+  protected function assertNoConfigOverride(string $config_name, string $langcode): void {
     $config_langcode = $this->configFactory->getEditable($config_name)->get('langcode');
     $override = $this->languageManager->getLanguageConfigOverride($langcode, $config_name);
     $this->assertNotEquals($langcode, $config_langcode);
@@ -401,12 +403,14 @@ protected function assertNoConfigOverride($config_name, $langcode) {
    *   The configuration name.
    * @param string $key
    *   The configuration key.
-   * @param string $value
+   * @param string|array $value
    *   The configuration value.
    * @param string $langcode
    *   The language code.
+   *
+   * @internal
    */
-  protected function assertConfigOverride($config_name, $key, $value, $langcode) {
+  protected function assertConfigOverride(string $config_name, string $key, $value, string $langcode): void {
     $config_langcode = $this->configFactory->getEditable($config_name)->get('langcode');
     $override = $this->languageManager->getLanguageConfigOverride($langcode, $config_name);
     $this->assertNotEquals($langcode, $config_langcode);
@@ -424,8 +428,10 @@ protected function assertConfigOverride($config_name, $key, $value, $langcode) {
    *   The configuration value.
    * @param string $langcode
    *   The language code.
+   *
+   * @internal
    */
-  protected function assertActiveConfig($config_name, $key, $value, $langcode) {
+  protected function assertActiveConfig(string $config_name, string $key, string $value, string $langcode): void {
     $config = $this->configFactory->getEditable($config_name);
     $this->assertEquals($langcode, $config->get('langcode'));
     $this->assertSame($value, $config->get($key));
@@ -438,8 +444,10 @@ protected function assertActiveConfig($config_name, $key, $value, $langcode) {
    *   The configuration name.
    * @param string $langcode
    *   The language code.
+   *
+   * @internal
    */
-  protected function assertNoTranslation($config_name, $langcode) {
+  protected function assertNoTranslation(string $config_name, string $langcode): void {
     $strings = $this->stringStorage->getTranslations([
       'type' => 'configuration',
       'name' => $config_name,
@@ -461,8 +469,10 @@ protected function assertNoTranslation($config_name, $langcode) {
    * @param bool $customized
    *   Whether or not the string should be asserted to be customized or not
    *   customized.
+   *
+   * @internal
    */
-  protected function assertTranslation($config_name, $translation, $langcode, $customized = TRUE) {
+  protected function assertTranslation(string $config_name, $translation, string $langcode, bool $customized = TRUE): void {
     // Make sure a string exists.
     $strings = $this->stringStorage->getTranslations([
       'type' => 'configuration',
diff --git a/core/modules/media/tests/src/Functional/MediaRevisionTest.php b/core/modules/media/tests/src/Functional/MediaRevisionTest.php
index f3361c76b49f..d3c89fc72a3d 100644
--- a/core/modules/media/tests/src/Functional/MediaRevisionTest.php
+++ b/core/modules/media/tests/src/Functional/MediaRevisionTest.php
@@ -190,8 +190,10 @@ protected function createMediaRevision(MediaInterface $media) {
    *   The entity in question.
    * @param int $expected_revisions
    *   The expected number of revisions.
+   *
+   * @internal
    */
-  protected function assertRevisionCount(EntityInterface $entity, $expected_revisions) {
+  protected function assertRevisionCount(EntityInterface $entity, int $expected_revisions): void {
     $entity_type = $entity->getEntityType();
 
     $count = $this->container
diff --git a/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php b/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php
index 828f2e0317b1..5446c3a3ca7e 100644
--- a/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php
+++ b/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php
@@ -475,8 +475,10 @@ public function testMediaCreateRedirect() {
    *   A list of the help texts to check.
    * @param string $selector
    *   (optional) The selector to search.
+   *
+   * @internal
    */
-  public function assertHelpTexts(array $texts, $selector = '') {
+  public function assertHelpTexts(array $texts, string $selector = ''): void {
     $assert_session = $this->assertSession();
     foreach ($texts as $text) {
       // We only want to escape single quotes, so use str_replace() rather than
@@ -496,8 +498,10 @@ public function assertHelpTexts(array $texts, $selector = '') {
    *
    * @param string[] $texts
    *   A list of the help texts to check.
+   *
+   * @internal
    */
-  public function assertNoHelpTexts(array $texts) {
+  public function assertNoHelpTexts(array $texts): void {
     $assert_session = $this->assertSession();
     foreach ($texts as $text) {
       $assert_session->pageTextNotContains($text);
@@ -514,8 +518,10 @@ public function assertNoHelpTexts(array $texts) {
    * @param string[] $attributes
    *   An associative array of any expected attributes, keyed by the
    *   attribute name.
+   *
+   * @internal
    */
-  protected function assertHelpLink(NodeElement $element, $text, array $attributes = []) {
+  protected function assertHelpLink(NodeElement $element, string $text, array $attributes = []): void {
     // Find all the links inside the element.
     $link = $element->findLink($text);
 
@@ -532,8 +538,10 @@ protected function assertHelpLink(NodeElement $element, $text, array $attributes
    *   The element to search.
    * @param string $text
    *   The link text.
+   *
+   * @internal
    */
-  protected function assertNoHelpLink(NodeElement $element, $text) {
+  protected function assertNoHelpLink(NodeElement $element, string $text): void {
     $assert_session = $this->assertSession();
     // Assert that the link and its text are not present anywhere on the page.
     $assert_session->elementNotExists('named', ['link', $text], $element);
diff --git a/core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php b/core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
index d192edcde704..5785a13a680d 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
@@ -1415,11 +1415,13 @@ protected function leaveSourceMode() {
    *
    * @param string $attribute
    *   The attribute to check.
-   * @param mixed $value
+   * @param string|null $value
    *   Either a string value or if NULL, asserts that <drupal-media> element
    *   doesn't have the attribute.
+   *
+   * @internal
    */
-  protected function assertSourceAttributeSame($attribute, $value) {
+  protected function assertSourceAttributeSame(string $attribute, ?string $value): void {
     $this->assertNotEmpty($drupal_media = $this->getDrupalMediaFromSource());
     if ($value === NULL) {
       $this->assertFalse($drupal_media->hasAttribute($attribute));
@@ -1524,8 +1526,10 @@ protected function openContextMenu($instance_id = 'edit-body-0-value') {
    *
    * @param string $label
    *   The `aria-label` attribute value of the context menu item.
+   *
+   * @internal
    */
-  protected function assertContextMenuItemExists($label) {
+  protected function assertContextMenuItemExists(string $label): void {
     $this->assertSession()->elementExists('xpath', '//a[@aria-label="' . $label . '"]');
   }
 
@@ -1534,8 +1538,10 @@ protected function assertContextMenuItemExists($label) {
    *
    * @param string $label
    *   The `aria-label` attribute value of the context menu item.
+   *
+   * @internal
    */
-  protected function assertContextMenuItemNotExists($label) {
+  protected function assertContextMenuItemNotExists(string $label): void {
     $this->assertSession()->elementNotExists('xpath', '//a[@aria-label="' . $label . '"]');
   }
 
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceImageTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceImageTest.php
index e4a0f942c4e0..9f17c9245e2d 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceImageTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceImageTest.php
@@ -159,8 +159,10 @@ public function testMediaImageSource() {
    *
    * @param string $media_type_id
    *   The media type ID.
+   *
+   * @internal
    */
-  protected function assertViewDisplayConfigured($media_type_id) {
+  protected function assertViewDisplayConfigured(string $media_type_id): void {
     $assert_session = $this->assertSession();
     $type = MediaType::load($media_type_id);
     $display = EntityViewDisplay::load('media.' . $media_type_id . '.' . EntityDisplayRepositoryInterface::DEFAULT_DISPLAY_MODE);
diff --git a/core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php b/core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php
index 59fa8af6ace9..f6d00a3da6d8 100644
--- a/core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php
@@ -92,8 +92,10 @@ public function testCreateAccess(array $permissions, AccessResultInterface $expe
    *   Expected cache tags.
    * @param \Drupal\Core\Access\AccessResultInterface $actual
    *   The actual access result.
+   *
+   * @internal
    */
-  protected function assertAccess(AccessResultInterface $expected_access_result, array $expected_cache_contexts, array $expected_cache_tags, AccessResultInterface $actual) {
+  protected function assertAccess(AccessResultInterface $expected_access_result, array $expected_cache_contexts, array $expected_cache_tags, AccessResultInterface $actual): void {
     $this->assertSame($expected_access_result->isAllowed(), $actual->isAllowed());
     $this->assertSame($expected_access_result->isForbidden(), $actual->isForbidden());
     $this->assertSame($expected_access_result->isNeutral(), $actual->isNeutral());
diff --git a/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php b/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php
index b24dcc6903b8..e83c5e31831b 100644
--- a/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php
+++ b/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php
@@ -222,8 +222,10 @@ public function testDisplayModes() {
    * @param bool $has_source_field
    *   Whether the media library form display should contain the source field or
    *   not.
+   *
+   * @internal
    */
-  protected function assertFormDisplay($type_id, $has_name, $has_source_field) {
+  protected function assertFormDisplay(string $type_id, bool $has_name, bool $has_source_field): void {
     // These components are added by default and invisible.
     $components = [
       'revision_log_message',
@@ -254,8 +256,10 @@ protected function assertFormDisplay($type_id, $has_name, $has_source_field) {
    *   The media type ID.
    * @param string $image_style
    *   The ID of the image style that should be configured for the thumbnail.
+   *
+   * @internal
    */
-  protected function assertViewDisplay($type_id, $image_style) {
+  protected function assertViewDisplay(string $type_id, string $image_style): void {
     $view_display = EntityViewDisplay::load('media.' . $type_id . '.media_library');
     $this->assertInstanceOf(EntityViewDisplay::class, $view_display);
     // Assert the media library view display contains only the thumbnail.
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/ContentModerationTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/ContentModerationTest.php
index 07b8f514f19c..dd21529b76eb 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/ContentModerationTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/ContentModerationTest.php
@@ -312,8 +312,10 @@ public function testWidget() {
 
   /**
    * Asserts all media items are visible.
+   *
+   * @internal
    */
-  protected function assertAllMedia() {
+  protected function assertAllMedia(): void {
     $assert_session = $this->assertSession();
     $assert_session->pageTextContains('Hoglet');
     $assert_session->pageTextContains('Panda');
@@ -322,8 +324,10 @@ protected function assertAllMedia() {
 
   /**
    * Asserts only published media items are visible.
+   *
+   * @internal
    */
-  protected function assertOnlyPublishedMedia() {
+  protected function assertOnlyPublishedMedia(): void {
     $assert_session = $this->assertSession();
     $assert_session->pageTextNotContains('Hoglet');
     $assert_session->pageTextContains('Panda');
diff --git a/core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php b/core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php
index e61776238f04..2b582a82633b 100644
--- a/core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php
+++ b/core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php
@@ -430,7 +430,7 @@ public function testAddFormAccess(): void {
    * @param string[] $expected_cache_contexts
    *   (optional) The expected cache contexts attached to the access result.
    */
-  private function assertAccess(AccessResult $access_result, $is_allowed, $expected_reason = NULL, array $expected_cache_tags = [], array $expected_cache_contexts = []) {
+  private function assertAccess(AccessResult $access_result, bool $is_allowed, string $expected_reason = NULL, array $expected_cache_tags = [], array $expected_cache_contexts = []): void {
     $this->assertSame($is_allowed, $access_result->isAllowed());
     if ($access_result instanceof AccessResultReasonInterface && isset($expected_reason)) {
       $this->assertSame($expected_reason, $access_result->getReason());
diff --git a/core/modules/media_library/tests/src/Kernel/MediaLibraryWidgetTest.php b/core/modules/media_library/tests/src/Kernel/MediaLibraryWidgetTest.php
index e5fc54ff9e20..57e3ef47f652 100644
--- a/core/modules/media_library/tests/src/Kernel/MediaLibraryWidgetTest.php
+++ b/core/modules/media_library/tests/src/Kernel/MediaLibraryWidgetTest.php
@@ -4,10 +4,12 @@
 
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\Form\FormState;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\entity_test\Entity\EntityTest;
 use Drupal\entity_test\Entity\EntityTestRev;
 use Drupal\KernelTests\KernelTestBase;
 use Drupal\media\Entity\MediaType;
+use Drupal\media_library\MediaLibraryState;
 use Drupal\Tests\user\Traits\UserCreationTrait;
 
 /**
@@ -128,8 +130,10 @@ public function testRevisionableWidgetAccess() {
    *   The media library state.
    *
    * @throws \Exception
+   *
+   * @internal
    */
-  protected function assertMediaLibraryStateAccess($access, $user, $state) {
+  protected function assertMediaLibraryStateAccess(bool $access, AccountInterface $user, MediaLibraryState $state): void {
     $ui_builder = $this->container->get('media_library.ui_builder');
     $access_result = $ui_builder->checkAccess($user, $state);
     $this->assertEquals($access, $access_result->isAllowed());
diff --git a/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php b/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php
index 61279cb7a76c..894bb59993d1 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php
@@ -120,8 +120,10 @@ public function createLinkHierarchy($module = 'menu_test') {
 
   /**
    * Assert that at set of links is properly parented.
+   *
+   * @internal
    */
-  public function assertMenuLinkParents($links, $expected_hierarchy) {
+  public function assertMenuLinkParents(array $links, array $expected_hierarchy): void {
     foreach ($expected_hierarchy as $id => $parent) {
       /** @var \Drupal\Core\Menu\MenuLinkInterface $menu_link_plugin  */
       $menu_link_plugin = $this->menuLinkManager->createInstance($links[$id]);
diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTest.php
index bc72be37598d..c21a085fd5b0 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTest.php
@@ -53,7 +53,7 @@ protected function setUp(): void {
    *   The expected title of the link.
    * @param string $menu
    *   The expected ID of the menu to which the link will belong.
-   * @param string $description
+   * @param string|null $description
    *   The link's expected description.
    * @param bool $enabled
    *   Whether the link is enabled.
@@ -66,10 +66,9 @@ protected function setUp(): void {
    * @param int $weight
    *   The expected weight of the link.
    *
-   * @return \Drupal\menu_link_content\MenuLinkContentInterface
-   *   The menu link content.
+   * @internal
    */
-  protected function assertEntity($id, $title, $menu, $description, $enabled, $expanded, array $attributes, $uri, $weight) {
+  protected function assertEntity(string $id, string $title, string $menu, ?string $description, bool $enabled, bool $expanded, array $attributes, string $uri, int $weight): void {
     /** @var \Drupal\menu_link_content\MenuLinkContentInterface $menu_link */
     $menu_link = MenuLinkContent::load($id);
     $this->assertInstanceOf(MenuLinkContentInterface::class, $menu_link);
@@ -81,7 +80,6 @@ protected function assertEntity($id, $title, $menu, $description, $enabled, $exp
     $this->assertSame($attributes, $menu_link->link->options);
     $this->assertSame($uri, $menu_link->link->uri);
     $this->assertSame($weight, $menu_link->getWeight());
-    return $menu_link;
   }
 
   /**
diff --git a/core/modules/migrate/tests/src/Kernel/HighWaterTest.php b/core/modules/migrate/tests/src/Kernel/HighWaterTest.php
index f45a662758f1..0793ea3652e2 100644
--- a/core/modules/migrate/tests/src/Kernel/HighWaterTest.php
+++ b/core/modules/migrate/tests/src/Kernel/HighWaterTest.php
@@ -267,8 +267,10 @@ public function testHighWaterUpdate() {
    *
    * @param string $title
    *   Title of the node.
+   *
+   * @internal
    */
-  protected function assertNodeExists($title) {
+  protected function assertNodeExists(string $title): void {
     self::assertTrue($this->nodeExists($title));
   }
 
@@ -277,8 +279,10 @@ protected function assertNodeExists($title) {
    *
    * @param string $title
    *   Title of the node.
+   *
+   * @internal
    */
-  protected function assertNodeDoesNotExist($title) {
+  protected function assertNodeDoesNotExist(string $title): void {
     self::assertFalse($this->nodeExists($title));
   }
 
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php
index 1123737bcfa5..b5fb3ec25024 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php
@@ -67,8 +67,10 @@ protected function setUp(): void {
    *   The expected default translation language code.
    * @param string[] $others
    *   The expected other translation language codes.
+   *
+   * @internal
    */
-  protected function assertTranslations($id, $default, $others = []) {
+  protected function assertTranslations(int $id, string $default, array $others = []): void {
     $entity = $this->storage->load($id);
     $this->assertNotEmpty($entity, "Entity exists");
     $this->assertEquals($default, $entity->language()->getId(), "Entity default translation");
diff --git a/core/modules/migrate/tests/src/Kernel/TrackChangesTest.php b/core/modules/migrate/tests/src/Kernel/TrackChangesTest.php
index 04d45b8c04d6..1f8f80c1afbd 100644
--- a/core/modules/migrate/tests/src/Kernel/TrackChangesTest.php
+++ b/core/modules/migrate/tests/src/Kernel/TrackChangesTest.php
@@ -153,8 +153,10 @@ public function testTrackChanges() {
    *   Property to evaluate.
    * @param string $value
    *   Value to evaluate.
+   *
+   * @internal
    */
-  protected function assertTermExists($property, $value) {
+  protected function assertTermExists(string $property, string $value): void {
     self::assertTrue($this->termExists($property, $value));
   }
 
@@ -165,8 +167,10 @@ protected function assertTermExists($property, $value) {
    *   Property to evaluate.
    * @param string $value
    *   Value to evaluate.
+   *
+   * @internal
    */
-  protected function assertTermDoesNotExist($property, $value) {
+  protected function assertTermDoesNotExist(string $property, string $value): void {
     self::assertFalse($this->termExists($property, $value));
   }
 
diff --git a/core/modules/migrate/tests/src/Unit/process/FileCopyTest.php b/core/modules/migrate/tests/src/Unit/process/FileCopyTest.php
index dc7cce130bfa..72d55143b45d 100644
--- a/core/modules/migrate/tests/src/Unit/process/FileCopyTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/FileCopyTest.php
@@ -48,10 +48,12 @@ public function providerFileProcessBaseConstructor() {
    *
    * @param array $configuration
    *   The plugin configuration.
-   * @param $expected
+   * @param int $expected
    *   The expected value of the plugin configuration.
+   *
+   * @internal
    */
-  protected function assertPlugin($configuration, $expected) {
+  protected function assertPlugin(array $configuration, int $expected): void {
     $stream_wrapper_manager = $this->prophesize(StreamWrapperManagerInterface::class)->reveal();
     $file_system = $this->prophesize(FileSystemInterface::class)->reveal();
     $download_plugin = $this->prophesize(MigrateProcessInterface::class)->reveal();
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/DestinationCategoryTest.php b/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/DestinationCategoryTest.php
index eb07400d312a..900a374d4910 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/DestinationCategoryTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/DestinationCategoryTest.php
@@ -67,8 +67,10 @@ public function testD7Categories() {
    *
    * @param \Drupal\migrate\Plugin\MigrationInterface[] $migrations
    *   The migrations.
+   *
+   * @internal
    */
-  protected function assertCategories($migrations) {
+  protected function assertCategories(array $migrations): void {
     foreach ($migrations as $id => $migration) {
       $object_classes = class_parents($migration->getDestinationPlugin());
       $object_classes[] = get_class($migration->getDestinationPlugin());
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityTest.php b/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityTest.php
index 34a486053512..73cad339dc48 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityTest.php
@@ -186,8 +186,10 @@ protected function setUp(): void {
    *   The source plugin.
    * @param array $configuration
    *   The source plugin configuration (Nope, no getter available).
+   *
+   * @internal
    */
-  protected function assertIds(MigrateSourceInterface $source, array $configuration) {
+  protected function assertIds(MigrateSourceInterface $source, array $configuration): void {
     $ids = $source->getIds();
     [, $entity_type_id] = explode(PluginBase::DERIVATIVE_SEPARATOR, $source->getPluginId());
     $entity_type = \Drupal::entityTypeManager()->getDefinition($entity_type_id);
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeFormStepsTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeFormStepsTest.php
index 1d86b61ef8b3..f25d28e11d8f 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeFormStepsTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeFormStepsTest.php
@@ -127,8 +127,10 @@ public function testMigrateUpgradeReviewPage() {
    *   The WebAssert object.
    * @param string $expected
    *   The expected response text.
+   *
+   * @internal
    */
-  protected function assertFirstForm(WebAssert $session, $expected) {
+  protected function assertFirstForm(WebAssert $session, string $expected): void {
     $paths = [
       '',
       '/incremental',
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php
index 31feae3cccf5..4ee6cda5a7f6 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php
@@ -210,8 +210,10 @@ public function testUpgradeAndIncremental() {
 
   /**
    * Tests that follow-up migrations have been run successfully.
+   *
+   * @internal
    */
-  protected function assertFollowUpMigrationResults() {
+  protected function assertFollowUpMigrationResults(): void {
     $node = Node::load(10);
     $this->assertSame('12', $node->get('field_reference')->target_id);
     $this->assertSame('12', $node->get('field_reference_2')->target_id);
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php
index 7f1a26fd93fa..864c5dd8e477 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php
@@ -234,8 +234,10 @@ public function testUpgradeAndIncremental() {
 
   /**
    * Tests that follow-up migrations have been run successfully.
+   *
+   * @internal
    */
-  protected function assertFollowUpMigrationResults() {
+  protected function assertFollowUpMigrationResults(): void {
     $node = Node::load(2);
     $this->assertSame('4', $node->get('field_reference')->target_id);
     $this->assertSame('6', $node->get('field_reference_2')->target_id);
diff --git a/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php b/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
index a20379f16822..ac042c114582 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
@@ -207,12 +207,14 @@ public function testNodeAccessBasic() {
   /**
    * Checks taxonomy/term listings to ensure only accessible nodes are listed.
    *
-   * @param $is_admin
+   * @param bool $is_admin
    *   A boolean indicating whether the current user is an administrator. If
    *   TRUE, all nodes should be listed. If FALSE, only public nodes and the
    *   user's own private nodes should be listed.
+   *
+   * @internal
    */
-  protected function assertTaxonomyPage($is_admin) {
+  protected function assertTaxonomyPage(bool $is_admin): void {
     foreach ([$this->publicTid, $this->privateTid] as $tid_is_private => $tid) {
       $this->drupalGet("taxonomy/term/$tid");
       $this->nidsVisible = [];
diff --git a/core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php b/core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php
index e647190921fc..746a750fe39b 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php
@@ -76,8 +76,10 @@ protected function setUp(): void {
    *
    * @param array $expected
    *   Expected values, keyed by user ID, expected cache contexts as values.
+   *
+   * @internal
    */
-  protected function assertUserCacheContext(array $expected) {
+  protected function assertUserCacheContext(array $expected): void {
     foreach ($expected as $uid => $context) {
       if ($uid > 0) {
         $this->drupalLogin($this->userMapping[$uid]);
diff --git a/core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php b/core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php
index dc788da0a76f..c85042d625c3 100644
--- a/core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php
+++ b/core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php
@@ -114,8 +114,10 @@ public function testDisplayConfigurable(string $theme, string $metadata_region,
    *   The region of the node html content where meta data is expected.
    * @param bool $field_classes
    *   If TRUE, check for field--name-XXX classes.
+   *
+   * @internal
    */
-  protected function assertNodeHtml(NodeInterface $node, UserInterface $user, bool $is_inline, string $metadata_region, bool $field_classes) {
+  protected function assertNodeHtml(NodeInterface $node, UserInterface $user, bool $is_inline, string $metadata_region, bool $field_classes): void {
     $assert = $this->assertSession();
 
     $html_element = $is_inline ? 'span' : 'div';
diff --git a/core/modules/node/tests/src/Functional/NodeTestBase.php b/core/modules/node/tests/src/Functional/NodeTestBase.php
index 6705134a22fb..44dc2faec0eb 100644
--- a/core/modules/node/tests/src/Functional/NodeTestBase.php
+++ b/core/modules/node/tests/src/Functional/NodeTestBase.php
@@ -56,6 +56,8 @@ protected function setUp() {
    *   The node object to check.
    * @param \Drupal\Core\Session\AccountInterface $account
    *   The user account for which to check access.
+   *
+   * @internal
    */
   public function assertNodeAccess(array $ops, NodeInterface $node, AccountInterface $account) {
     foreach ($ops as $op => $result) {
@@ -75,8 +77,10 @@ public function assertNodeAccess(array $ops, NodeInterface $node, AccountInterfa
    * @param string|null $langcode
    *   (optional) The language code indicating which translation of the node
    *   to check. If NULL, the untranslated (fallback) access is checked.
+   *
+   * @internal
    */
-  public function assertNodeCreateAccess($bundle, $result, AccountInterface $account, $langcode = NULL) {
+  public function assertNodeCreateAccess(string $bundle, bool $result, AccountInterface $account, ?string $langcode = NULL) {
     $this->assertEquals($this->accessHandler->createAccess($bundle, $account, ['langcode' => $langcode]), $result, $this->nodeAccessAssertMessage('create', $result, $langcode));
   }
 
diff --git a/core/modules/node/tests/src/Functional/Views/FrontPageTest.php b/core/modules/node/tests/src/Functional/Views/FrontPageTest.php
index bf1cc6ac20d7..1ee1b6606dce 100644
--- a/core/modules/node/tests/src/Functional/Views/FrontPageTest.php
+++ b/core/modules/node/tests/src/Functional/Views/FrontPageTest.php
@@ -166,8 +166,10 @@ public function testFrontPage() {
    *   An array of nids which should not be part of the resultset.
    * @param string $message
    *   (optional) A custom message to display with the assertion.
+   *
+   * @internal
    */
-  protected function assertNotInResultSet(ViewExecutable $view, array $not_expected_nids, $message = '') {
+  protected function assertNotInResultSet(ViewExecutable $view, array $not_expected_nids, string $message = ''): void {
     $found_nids = array_filter($view->result, function ($row) use ($not_expected_nids) {
       return in_array($row->nid, $not_expected_nids);
     });
diff --git a/core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php b/core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php
index 33105bebc3b8..e94a11ecb3ac 100644
--- a/core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php
@@ -97,8 +97,10 @@ public function testFilters() {
    *   that translation should be shown on the given page.
    * @param string $message
    *   Message suffix to display.
+   *
+   * @internal
    */
-  protected function assertPageCounts($path, $counts, $message) {
+  protected function assertPageCounts(string $path, array $counts, string $message): void {
     // Disable read more links.
     \Drupal::service('entity_display.repository')
       ->getViewDisplay('node', 'page', 'teaser')
diff --git a/core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php b/core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php
index dec8d923967f..ea0cfe411acc 100644
--- a/core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php
@@ -59,8 +59,10 @@ public function testNodeViewTypeArgument() {
    *
    * @param array $expected_nids
    *   An array of node IDs.
+   *
+   * @internal
    */
-  protected function assertNids(array $expected_nids = []) {
+  protected function assertNids(array $expected_nids = []): void {
     $result = $this->xpath('//span[@class="field-content"]');
     $nids = [];
     foreach ($result as $element) {
diff --git a/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php b/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php
index 986f59cbc09f..c5bd79ccb953 100644
--- a/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php
@@ -281,8 +281,10 @@ public function testNativeLanguageField() {
    *
    * @param bool $native
    *   (optional) Whether to assert the language name in its native form.
+   *
+   * @internal
    */
-  protected function assertLanguageNames($native = FALSE) {
+  protected function assertLanguageNames(bool $native = FALSE): void {
     $this->drupalGet('test-language');
     if ($native) {
       $this->assertSession()->pageTextContains('Français');
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeCompleteTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeCompleteTest.php
index 298df46b55f9..324feb7cd707 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeCompleteTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeCompleteTest.php
@@ -96,8 +96,10 @@ public function testNodeCompleteMigration() {
    *   An array of revision data matching a node_field_revision table row.
    * @param array $data
    *   An array of revision data.
+   *
+   * @internal
    */
-  protected function assertRevision(array $revision, array $data) {
+  protected function assertRevision(array $revision, array $data): void {
     /** @var  \Drupal\node\NodeInterface $actual */
     $actual = $this->nodeStorage->loadRevision($revision['vid'])
       ->getTranslation($revision['langcode']);
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeRevisionTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeRevisionTest.php
index d975e9e4b8fa..ed3bc55add43 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeRevisionTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeRevisionTest.php
@@ -42,19 +42,21 @@ protected function setUp(): void {
    *   The revision language.
    * @param string $title
    *   The expected title.
-   * @param string $log
+   * @param string|null $log
    *   The revision log message.
    * @param int $timestamp
    *   The revision's time stamp.
+   *
+   * @internal
    */
-  protected function assertRevision($id, $langcode, $title, $log, $timestamp) {
+  protected function assertRevision(int $id, string $langcode, string $title, ?string $log, int $timestamp): void {
     /** @var  \Drupal\node\NodeInterface $revision */
     $revision = $this->nodeStorage->loadRevision($id)
       ->getTranslation($langcode);
     $this->assertInstanceOf(NodeInterface::class, $revision);
     $this->assertSame($title, $revision->getTitle());
     $this->assertSame($log, $revision->revision_log->value);
-    $this->assertSame($timestamp, $revision->getRevisionCreationTime());
+    $this->assertSame($timestamp, (int) $revision->getRevisionCreationTime());
   }
 
   /**
@@ -73,27 +75,27 @@ public function testNodeRevision() {
     $this->assertSame('modified rev 3', $node->revision_log->value);
     $this->assertSame('1420861423', $node->getRevisionCreationTime());
 
-    $this->assertRevision(1, 'und', 'Test title', NULL, '1390095702');
-    $this->assertRevision(3, 'und', 'Test title rev 3', NULL, '1420718386');
-    $this->assertRevision(4, 'und', 'Test page title rev 4', NULL, '1390095701');
-    $this->assertRevision(5, 'und', 'Test title rev 2', 'modified rev 2', '1390095703');
-    $this->assertRevision(6, 'und', 'Node 4', NULL, '1390095701');
-    $this->assertRevision(7, 'und', 'Node 5', NULL, '1390095701');
-    $this->assertRevision(8, 'und', 'Node 6', NULL, '1390095701');
-    $this->assertRevision(9, 'und', 'Node 7', NULL, '1390095701');
-    $this->assertRevision(10, 'und', 'Node 8', NULL, '1390095701');
-    $this->assertRevision(11, 'und', 'Node 9', NULL, '1390095701');
-    $this->assertRevision(12, 'und', 'Once upon a time', NULL, '1444671588');
-    $this->assertRevision(13, 'en', 'The Real McCoy', NULL, '1444238808');
-    $this->assertRevision(15, 'zu', 'Abantu zulu', NULL, '1444238808');
-    $this->assertRevision(17, 'und', 'United Federation of Planets', NULL, '1493066668');
-    $this->assertRevision(18, 'und', 'Klingon Empire', NULL, '1493066677');
-    $this->assertRevision(19, 'und', 'Romulan Empire', NULL, '1493066684');
-    $this->assertRevision(20, 'und', 'Ferengi Commerce Authority', NULL, '1493066693');
-    $this->assertRevision(21, 'und', 'Ambassador Sarek', NULL, '1494966544');
-    $this->assertRevision(22, 'und', 'New Forum Topic', NULL, '1501955771');
-    $this->assertRevision(2001, 'und', 'Test title rev 3', 'modified rev 3', '1420861423');
-    $this->assertRevision(2002, 'en', 'John Smith - EN', NULL, '1534014650');
+    $this->assertRevision(1, 'und', 'Test title', NULL, 1390095702);
+    $this->assertRevision(3, 'und', 'Test title rev 3', NULL, 1420718386);
+    $this->assertRevision(4, 'und', 'Test page title rev 4', NULL, 1390095701);
+    $this->assertRevision(5, 'und', 'Test title rev 2', 'modified rev 2', 1390095703);
+    $this->assertRevision(6, 'und', 'Node 4', NULL, 1390095701);
+    $this->assertRevision(7, 'und', 'Node 5', NULL, 1390095701);
+    $this->assertRevision(8, 'und', 'Node 6', NULL, 1390095701);
+    $this->assertRevision(9, 'und', 'Node 7', NULL, 1390095701);
+    $this->assertRevision(10, 'und', 'Node 8', NULL, 1390095701);
+    $this->assertRevision(11, 'und', 'Node 9', NULL, 1390095701);
+    $this->assertRevision(12, 'und', 'Once upon a time', NULL, 1444671588);
+    $this->assertRevision(13, 'en', 'The Real McCoy', NULL, 1444238808);
+    $this->assertRevision(15, 'zu', 'Abantu zulu', NULL, 1444238808);
+    $this->assertRevision(17, 'und', 'United Federation of Planets', NULL, 1493066668);
+    $this->assertRevision(18, 'und', 'Klingon Empire', NULL, 1493066677);
+    $this->assertRevision(19, 'und', 'Romulan Empire', NULL, 1493066684);
+    $this->assertRevision(20, 'und', 'Ferengi Commerce Authority', NULL, 1493066693);
+    $this->assertRevision(21, 'und', 'Ambassador Sarek', NULL, 1494966544);
+    $this->assertRevision(22, 'und', 'New Forum Topic', NULL, 1501955771);
+    $this->assertRevision(2001, 'und', 'Test title rev 3', 'modified rev 3', 1420861423);
+    $this->assertRevision(2002, 'en', 'John Smith - EN', NULL, 1534014650);
 
     // Test that the revision translations are not migrated and there should not
     // be a revision with id of 2003.
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php
index 1d38c9710445..3f5039c9a9c3 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php
@@ -194,8 +194,10 @@ public function testRollbackNodeComplete() {
    *   An array of revision data matching a node_field_revision table row.
    * @param array $data
    *   An array of revision data.
+   *
+   * @internal
    */
-  protected function assertRevision(array $revision, array $data) {
+  protected function assertRevision(array $revision, array $data): void {
     /** @var  \Drupal\node\NodeInterface $actual */
     $actual = $this->nodeStorage->loadRevision($revision['vid'])
       ->getTranslation($revision['langcode']);
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php
index 50cabf5f185f..04656656c2ac 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php
@@ -92,30 +92,32 @@ protected function getFileMigrationInfo() {
    *   The revision language.
    * @param string $title
    *   The expected title.
-   * @param string $log
+   * @param string|null $log
    *   The revision log message.
    * @param int $timestamp
    *   The revision's time stamp.
+   *
+   * @internal
    */
-  protected function assertRevision($id, $langcode, $title, $log, $timestamp) {
+  protected function assertRevision(int $id, string $langcode, string $title, ?string $log, int $timestamp): void {
     $revision = $this->nodeStorage->loadRevision($id);
     $this->assertInstanceOf(NodeInterface::class, $revision);
     $this->assertSame($title, $revision->getTitle());
     $this->assertSame($langcode, $revision->language()->getId());
     $this->assertSame($log, $revision->revision_log->value);
-    $this->assertSame($timestamp, $revision->getRevisionCreationTime());
+    $this->assertSame($timestamp, (int) $revision->getRevisionCreationTime());
   }
 
   /**
    * Tests the migration of node revisions with translated nodes.
    */
   public function testNodeRevisions() {
-    $this->assertRevision(1, 'en', 'An English Node', NULL, '1441032132');
-    $this->assertRevision(2, 'en', 'The thing about Deep Space 9 (1st rev)', 'DS9 1st rev', '1564543588');
-    $this->assertRevision(4, 'is', 'is - The thing about Firefly (1st rev)', 'is - Firefly 1st rev', '1478755274');
-    $this->assertRevision(6, 'en', 'Comments are closed :-(', NULL, '1504715414');
-    $this->assertRevision(7, 'en', 'Comments are open :-)', NULL, '1504715432');
-    $this->assertRevision(8, 'en', 'The number 47', NULL, '1552126363');
+    $this->assertRevision(1, 'en', 'An English Node', NULL, 1441032132);
+    $this->assertRevision(2, 'en', 'The thing about Deep Space 9 (1st rev)', 'DS9 1st rev', 1564543588);
+    $this->assertRevision(4, 'is', 'is - The thing about Firefly (1st rev)', 'is - Firefly 1st rev', 1478755274);
+    $this->assertRevision(6, 'en', 'Comments are closed :-(', NULL, 1504715414);
+    $this->assertRevision(7, 'en', 'Comments are open :-)', NULL, 1504715432);
+    $this->assertRevision(8, 'en', 'The number 47', NULL, 1552126363);
 
     // Test that the revision translation are not migrated and there should not
     // be a revision with id of 9.
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
index 0c62e6251dec..f91b9f720796 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
@@ -103,8 +103,10 @@ protected function getFileMigrationInfo() {
    *   Whether the node is expected to be promoted to the front page.
    * @param bool $sticky
    *   Whether the node is expected to be sticky.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $type, $langcode, $title, $uid, $status, $created, $changed, $promoted, $sticky) {
+  protected function assertEntity(string $id, string $type, string $langcode, string $title, int $uid, bool $status, int $created, int $changed, bool $promoted, bool $sticky): void {
     /** @var \Drupal\node\NodeInterface $node */
     $node = Node::load($id);
     $this->assertInstanceOf(NodeInterface::class, $node);
@@ -130,12 +132,14 @@ protected function assertEntity($id, $type, $langcode, $title, $uid, $status, $c
    *   The expected title.
    * @param int $uid
    *   The revision author ID.
-   * @param string $log
+   * @param string|null $log
    *   The revision log message.
    * @param int $timestamp
    *   The revision's time stamp.
+   *
+   * @internal
    */
-  protected function assertRevision($id, $title, $uid, $log, $timestamp) {
+  protected function assertRevision(int $id, string $title, int $uid, ?string $log, int $timestamp): void {
     $revision = \Drupal::entityTypeManager()->getStorage('node')->loadRevision($id);
     $this->assertInstanceOf(NodeInterface::class, $revision);
     $this->assertEquals($title, $revision->getTitle());
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTitleLabelTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTitleLabelTest.php
index e0c6773c4cef..9b79ea1092a9 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTitleLabelTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTitleLabelTest.php
@@ -30,8 +30,10 @@ protected function setUp(): void {
    *   The override ID.
    * @param string $label
    *   The label's expected (overridden) value.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $label) {
+  protected function assertEntity(string $id, string $label): void {
     $override = BaseFieldOverride::load($id);
     $this->assertInstanceOf(BaseFieldOverride::class, $override);
     /** @var \Drupal\Core\Field\Entity\BaseFieldOverride $override */
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php
index 94a579c8703b..70f2a26e1b52 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php
@@ -45,14 +45,16 @@ protected function setUp(): void {
    *   If submission information is displayed.
    * @param bool $new_revision
    *   If this is a new revision.
-   * @param array $expected_available_menus
+   * @param array|null $expected_available_menus
    *   The expected menus.
-   * @param string $expected_parent
+   * @param string|null $expected_parent
    *   The expected menu parents.
    * @param string|null $body_label
    *   (optional) The label for the body field.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $label, $description, $help, $display_submitted, $new_revision, $expected_available_menus, $expected_parent, $body_label = NULL) {
+  protected function assertEntity(string $id, string $label, string $description, string $help, bool $display_submitted, bool $new_revision, ?array $expected_available_menus, ?string $expected_parent, ?string $body_label = NULL): void {
     /** @var \Drupal\node\NodeTypeInterface $entity */
     $entity = NodeType::load($id);
     $this->assertInstanceOf(NodeTypeInterface::class, $entity);
diff --git a/core/modules/node/tests/src/Kernel/NodeAccessTestBase.php b/core/modules/node/tests/src/Kernel/NodeAccessTestBase.php
index 3ee8ba16f323..32eca5d6ba2b 100644
--- a/core/modules/node/tests/src/Kernel/NodeAccessTestBase.php
+++ b/core/modules/node/tests/src/Kernel/NodeAccessTestBase.php
@@ -91,6 +91,8 @@ protected function setUp() {
    *   The node object to check.
    * @param \Drupal\Core\Session\AccountInterface $account
    *   The user account for which to check access.
+   *
+   * @internal
    */
   public function assertNodeAccess(array $ops, NodeInterface $node, AccountInterface $account) {
     foreach ($ops as $op => $result) {
@@ -111,8 +113,10 @@ public function assertNodeAccess(array $ops, NodeInterface $node, AccountInterfa
    * @param string|null $langcode
    *   (optional) The language code indicating which translation of the node
    *   to check. If NULL, the untranslated (fallback) access is checked.
+   *
+   * @internal
    */
-  public function assertNodeCreateAccess($bundle, $result, AccountInterface $account, $langcode = NULL) {
+  public function assertNodeCreateAccess(string $bundle, bool $result, AccountInterface $account, ?string $langcode = NULL) {
     $this->assertEquals($result, $this->accessHandler->createAccess($bundle, $account, [
       'langcode' => $langcode,
     ]), $this->nodeAccessAssertMessage('create', $result, $langcode));
diff --git a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
index e3d732464eee..23e965bd4174 100644
--- a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
+++ b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
@@ -306,16 +306,18 @@ protected function createOptionsField($type) {
   /**
    * Tests a string input for the 'allowed values' form element.
    *
-   * @param $input_string
+   * @param string $input_string
    *   The input string, in the pipe-linefeed format expected by the form
    *   element.
-   * @param $result
+   * @param array|string $result
    *   Either an expected resulting array in
    *   $field->getSetting('allowed_values'), or an expected error message.
-   * @param $message
+   * @param string $message
    *   Message to display.
+   *
+   * @internal
    */
-  public function assertAllowedValuesInput($input_string, $result, $message) {
+  public function assertAllowedValuesInput(string $input_string, $result, string $message): void {
     $edit = ['settings[allowed_values]' => $input_string];
     $this->drupalGet($this->adminPath);
     $this->submitForm($edit, 'Save field settings');
diff --git a/core/modules/path/tests/src/Functional/PathContentModerationTest.php b/core/modules/path/tests/src/Functional/PathContentModerationTest.php
index dbc9b0f788cd..46e9a92d2e01 100644
--- a/core/modules/path/tests/src/Functional/PathContentModerationTest.php
+++ b/core/modules/path/tests/src/Functional/PathContentModerationTest.php
@@ -234,8 +234,10 @@ public function testTranslatedModeratedNodeAlias() {
    *
    * @param string[] $paths
    *   An array of paths to check for.
+   *
+   * @internal
    */
-  public function assertPathsAreAccessible(array $paths) {
+  public function assertPathsAreAccessible(array $paths): void {
     foreach ($paths as $path) {
       $this->drupalGet($path);
       $this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php b/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php
index 43bc7e72d312..065d229f1fba 100644
--- a/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php
+++ b/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php
@@ -58,8 +58,10 @@ protected function setUp(): void {
    *   The path conditions.
    * @param \Drupal\path_alias\PathAliasInterface $path_alias
    *   The path alias.
+   *
+   * @internal
    */
-  private function assertPath($pid, $conditions, PathAliasInterface $path_alias) {
+  private function assertPath(int $pid, array $conditions, PathAliasInterface $path_alias): void {
     $this->assertSame($pid, (int) $path_alias->id());
     $this->assertSame($conditions['alias'], $path_alias->getAlias());
     $this->assertSame($conditions['langcode'], $path_alias->get('langcode')->value);
diff --git a/core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php b/core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php
index cfac219e1da9..9accbe0435fb 100644
--- a/core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php
+++ b/core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php
@@ -93,12 +93,14 @@ public function testUrlAlter() {
   /**
    * Assert that an outbound path is altered to an expected value.
    *
-   * @param $original
+   * @param string $original
    *   A string with the original path that is run through generateFrommPath().
-   * @param $final
+   * @param string $final
    *   A string with the expected result after generateFrommPath().
+   *
+   * @internal
    */
-  protected function assertUrlOutboundAlter($original, $final) {
+  protected function assertUrlOutboundAlter(string $original, string $final): void {
     // Test outbound altering.
     $result = $this->container->get('path_processor_manager')->processOutbound($original);
     $this->assertSame($final, $result, new FormattableMarkup('Altered outbound URL %original, expected %final, and got %result.', ['%original' => $original, '%final' => $final, '%result' => $result]));
@@ -107,12 +109,14 @@ protected function assertUrlOutboundAlter($original, $final) {
   /**
    * Assert that an inbound path is altered to an expected value.
    *
-   * @param $original
+   * @param string $original
    *   The original path before it has been altered by inbound URL processing.
-   * @param $final
+   * @param string $final
    *   A string with the expected result.
+   *
+   * @internal
    */
-  protected function assertUrlInboundAlter($original, $final) {
+  protected function assertUrlInboundAlter(string $original, string $final): void {
     // Test inbound altering.
     $result = $this->container->get('path_alias.manager')->getPathByAlias($original);
     $this->assertSame($final, $result, new FormattableMarkup('Altered inbound URL %original, expected %final, and got %result.', ['%original' => $original, '%final' => $final, '%result' => $result]));
diff --git a/core/modules/quickedit/tests/src/Functional/QuickEditEndPointAccessTest.php b/core/modules/quickedit/tests/src/Functional/QuickEditEndPointAccessTest.php
index 1cb90adf40db..dbff08aa289f 100644
--- a/core/modules/quickedit/tests/src/Functional/QuickEditEndPointAccessTest.php
+++ b/core/modules/quickedit/tests/src/Functional/QuickEditEndPointAccessTest.php
@@ -76,8 +76,10 @@ public function testEndPointAccess() {
    *   The URL to check.
    * @param array $body
    *   The payload to send with the request.
+   *
+   * @internal
    */
-  protected function assertAccessIsBlocked($url, array $body) {
+  protected function assertAccessIsBlocked(string $url, array $body): void {
     $client = $this->getHttpClient();
     $message = ['message' => "The 'access in-place editing' permission is required."];
 
diff --git a/core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php b/core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
index daa5a192c4d9..05744d77eafc 100644
--- a/core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
+++ b/core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
@@ -214,14 +214,14 @@ protected function enableLayouts($path) {
   /**
    * {@inheritdoc}
    */
-  protected function assertEntityInstanceFieldStates($entity_type_id, $entity_id, $entity_instance_id, array $expected_field_states) {
+  protected function assertEntityInstanceFieldStates($entity_type_id, $entity_id, $entity_instance_id, array $expected_field_states): void {
     parent::assertEntityInstanceFieldStates($entity_type_id, $entity_id, $entity_instance_id, $this->replaceLayoutBuilderFieldIdKeys($expected_field_states));
   }
 
   /**
    * {@inheritdoc}
    */
-  protected function assertEntityInstanceFieldMarkup($expected_field_attributes) {
+  protected function assertEntityInstanceFieldMarkup($expected_field_attributes): void {
     if (func_num_args() === 4) {
       $expected_field_attributes = func_get_arg(3);
       @trigger_error('Calling ' . __METHOD__ . '() with 4 arguments is deprecated in drupal:9.1.0 and will throw an error in drupal:10.0.0. See https://www.drupal.org/project/drupal/issues/3037436', E_USER_DEPRECATED);
@@ -327,7 +327,7 @@ protected function disableLayoutBuilder($path) {
    * @param string[] $fields
    *   The fields test.
    */
-  private function assertQuickEditInit(array $fields) {
+  private function assertQuickEditInit(array $fields): void {
     $this->assertNotEmpty($fields);
     $node = $this->article;
     $this->drupalGet('node/' . $node->id());
diff --git a/core/modules/rdf/tests/src/Functional/StandardProfileTest.php b/core/modules/rdf/tests/src/Functional/StandardProfileTest.php
index 5cb15e01a43e..efe1f847da7c 100644
--- a/core/modules/rdf/tests/src/Functional/StandardProfileTest.php
+++ b/core/modules/rdf/tests/src/Functional/StandardProfileTest.php
@@ -338,8 +338,10 @@ protected function doTermRdfaTests() {
    *   The word to use in the test assertion message.
    *
    * @throws \Drupal\Core\Entity\EntityMalformedException
+   *
+   * @internal
    */
-  protected function assertRdfaCommonNodeProperties(NodeInterface $node, $message_prefix) {
+  protected function assertRdfaCommonNodeProperties(NodeInterface $node, string $message_prefix): void {
     $this->drupalGet($node->toUrl());
     $uri = $node->toUrl('canonical', ['absolute' => TRUE])->toString();
 
@@ -390,8 +392,10 @@ protected function assertRdfaCommonNodeProperties(NodeInterface $node, $message_
    *
    * @param string $message_prefix
    *   The word to use in the test assertion message.
+   *
+   * @internal
    */
-  protected function assertRdfaArticleProperties($message_prefix) {
+  protected function assertRdfaArticleProperties(string $message_prefix): void {
     // Tags.
     $expected_value = [
       'type' => 'uri',
@@ -415,8 +419,10 @@ protected function assertRdfaArticleProperties($message_prefix) {
 
   /**
    * Tests output for comment properties on nodes in full page view mode.
+   *
+   * @internal
    */
-  protected function assertRdfaNodeCommentProperties() {
+  protected function assertRdfaNodeCommentProperties(): void {
 
     $this->drupalGet($this->article->toUrl());
     // Relationship between node and comment.
diff --git a/core/modules/rdf/tests/src/Kernel/Migrate/d7/MigrateRdfMappingTest.php b/core/modules/rdf/tests/src/Kernel/Migrate/d7/MigrateRdfMappingTest.php
index 59c2157e86c9..bad3a45e4166 100644
--- a/core/modules/rdf/tests/src/Kernel/Migrate/d7/MigrateRdfMappingTest.php
+++ b/core/modules/rdf/tests/src/Kernel/Migrate/d7/MigrateRdfMappingTest.php
@@ -49,8 +49,10 @@ protected function setUp(): void {
    *   The expected RDF types.
    * @param array[] $field_mappings
    *   The expected RDF field mappings.
+   *
+   * @internal
    */
-  protected function assertRdfMapping($entity_type, $bundle, $types, $field_mappings) {
+  protected function assertRdfMapping(string $entity_type, string $bundle, array $types, array $field_mappings): void {
     $rdf_mapping = rdf_get_mapping($entity_type, $bundle);
     $this->assertInstanceOf(RdfMappingInterface::class, $rdf_mapping);
     $this->assertSame($types, $rdf_mapping->getBundleMapping());
diff --git a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
index b56b027fece9..ba2708ceda6e 100644
--- a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
+++ b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
@@ -469,7 +469,7 @@ public function testResponsiveImageFieldFormattersOneSource() {
    * @param string $link_type
    *   The link type to test. Either 'file' or 'content'.
    */
-  private function assertResponsiveImageFieldFormattersLink($link_type) {
+  private function assertResponsiveImageFieldFormattersLink(string $link_type): void {
     $field_name = mb_strtolower($this->randomMachineName());
     $field_settings = ['alt_field_required' => 0];
     $this->createImageField($field_name, 'article', ['uri_scheme' => 'public'], $field_settings);
diff --git a/core/modules/search/tests/src/Functional/SearchAdminThemeTest.php b/core/modules/search/tests/src/Functional/SearchAdminThemeTest.php
index 10f35c8ccd86..5f6c12ea7e8c 100644
--- a/core/modules/search/tests/src/Functional/SearchAdminThemeTest.php
+++ b/core/modules/search/tests/src/Functional/SearchAdminThemeTest.php
@@ -93,8 +93,10 @@ public function testSearchUsingAdminTheme() {
    *
    * @param bool $is_admin
    *   TRUE to test for administrative theme, FALSE otherwise.
+   *
+   * @internal
    */
-  protected function assertAdminTheme($is_admin) {
+  protected function assertAdminTheme(bool $is_admin): void {
     if ($is_admin) {
       $this->assertSession()->responseContains('core/themes/' . $this->adminTheme);
     }
diff --git a/core/modules/search/tests/src/Functional/SearchCommentTest.php b/core/modules/search/tests/src/Functional/SearchCommentTest.php
index d0148ca933e7..b07904e922e3 100644
--- a/core/modules/search/tests/src/Functional/SearchCommentTest.php
+++ b/core/modules/search/tests/src/Functional/SearchCommentTest.php
@@ -307,8 +307,10 @@ public function setRolePermissions($rid, $access_comments = FALSE, $search_conte
 
   /**
    * Update search index and search for comment.
+   *
+   * @internal
    */
-  public function assertCommentAccess($assume_access, $message) {
+  public function assertCommentAccess(bool $assume_access, string $message): void {
     // Invoke search index update.
     \Drupal::service('search.index')->markForReindex('node_search', $this->node->id());
     $this->cronRun();
diff --git a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
index 35d0fd16cd01..a5d4a7f71c68 100644
--- a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
@@ -408,17 +408,17 @@ protected function verifySearchPageOperations($id, $edit, $delete, $disable, $en
   /**
    * Checks that the default search page matches expectations.
    *
-   * @param string $expected
+   * @param string|false $expected
    *   The expected search page.
    * @param string $message
    *   (optional) A message to display with the assertion.
-   * @param string $group
-   *   (optional) The group this message is in.
+   *
+   * @internal
    */
-  protected function assertDefaultSearch($expected, $message = '', $group = 'Other') {
+  protected function assertDefaultSearch($expected, string $message = ''): void {
     /** @var \Drupal\search\SearchPageRepositoryInterface $search_page_repository */
     $search_page_repository = \Drupal::service('search.search_page_repository');
-    $this->assertSame($expected, $search_page_repository->getDefaultSearchPage(), $message, $group);
+    $this->assertSame($expected, $search_page_repository->getDefaultSearchPage(), $message);
   }
 
   /**
diff --git a/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php b/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php
index 7fcefbe50f5d..a8dbc5d130ba 100644
--- a/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php
+++ b/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php
@@ -284,8 +284,10 @@ public function testMultilingualSearch() {
    *   Count of total items to verify.
    * @param string $message
    *   Message to use, something like "after updating the search index".
+   *
+   * @internal
    */
-  protected function assertIndexCounts($remaining, $total, $message) {
+  protected function assertIndexCounts(int $remaining, int $total, string $message): void {
     // Check status via plugin method call.
     $status = $this->plugin->indexStatus();
     $this->assertEquals($remaining, $status['remaining'], 'Remaining items ' . $message . ' is ' . $remaining);
@@ -320,8 +322,10 @@ protected function assertIndexCounts($remaining, $total, $message) {
    *   Count of "foo" items to assert.
    * @param string $message
    *   Message suffix to use.
+   *
+   * @internal
    */
-  protected function assertDatabaseCounts($count_node, $count_foo, $message) {
+  protected function assertDatabaseCounts(int $count_node, int $count_foo, string $message): void {
     // Count number of distinct nodes by ID.
     $connection = Database::getConnection();
     $results = $connection->select('search_dataset', 'i')
diff --git a/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php b/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php
index 16106e75302f..d3e8ee38ea98 100644
--- a/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php
+++ b/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php
@@ -31,8 +31,10 @@ class MigrateSearchPageTest extends MigrateDrupal7TestBase {
    *   The expected status of the search page.
    * @param array $expected_config
    *   An array of expected configuration for the search page.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $path, $status = FALSE, array $expected_config = NULL) {
+  protected function assertEntity(string $id, string $path, bool $status = FALSE, array $expected_config = NULL): void {
     /** @var \Drupal\search\Entity\SearchPage $search_page */
     $search_page = SearchPage::load($id);
     $this->assertSame($id, $search_page->id());
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php
index 617dce5271d7..459ad5da43a6 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php
@@ -427,8 +427,10 @@ public function testDenormalizeWithId() {
    *
    * @param array $data
    *   The data to denormalize.
+   *
+   * @internal
    */
-  protected function assertDenormalize(array $data) {
+  protected function assertDenormalize(array $data): void {
     $this->fieldItem->getParent()
       ->willReturn($this->prophesize(FieldItemListInterface::class)->reveal());
     $this->fieldItem->getFieldDefinition()->willReturn($this->fieldDefinition->reveal());
diff --git a/core/modules/settings_tray/tests/src/FunctionalJavascript/OverriddenConfigurationTest.php b/core/modules/settings_tray/tests/src/FunctionalJavascript/OverriddenConfigurationTest.php
index cfe5c1566bb2..8d17f3a65270 100644
--- a/core/modules/settings_tray/tests/src/FunctionalJavascript/OverriddenConfigurationTest.php
+++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/OverriddenConfigurationTest.php
@@ -156,8 +156,10 @@ public function testOverriddenBlock() {
    *   The overridden block.
    * @param string $override_text
    *   The override text that should appear in the block.
+   *
+   * @internal
    */
-  protected function assertOverriddenBlockDisabled(Block $overridden_block, $override_text) {
+  protected function assertOverriddenBlockDisabled(Block $overridden_block, string $override_text): void {
     $web_assert = $this->assertSession();
     $page = $this->getSession()->getPage();
     $block_selector = $this->getBlockSelector($overridden_block);
diff --git a/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php b/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
index a3029053f4e2..4dc879b389fd 100644
--- a/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
+++ b/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
@@ -462,20 +462,13 @@ public function testShortcutBlockAccess() {
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use new FormattableMarkup() to embed variables in the message text, not
    *   t(). If left blank, a default message will be displayed.
-   * @param string $group
-   *   (optional) The group this message is in, which is displayed in a column
-   *   in test output. Use 'Debug' to indicate this is debugging output. Do not
-   *   translate this string. Defaults to 'Other'; most tests do not override
-   *   this default.
    *
-   * @return bool
-   *   TRUE if the assertion succeeded.
+   * @internal
    */
-  protected function assertShortcutQuickLink($label, $index = 0, $message = '', $group = 'Other') {
+  protected function assertShortcutQuickLink(string $label, int $index = 0, string $message = ''): void {
     $links = $this->xpath('//a[normalize-space()=:label]', [':label' => $label]);
     $message = ($message ? $message : new FormattableMarkup('Shortcut quick link with label %label found.', ['%label' => $label]));
     $this->assertArrayHasKey($index, $links, $message);
-    return TRUE;
   }
 
 }
diff --git a/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetTest.php b/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetTest.php
index 61b438abbc5e..c932114e6e96 100644
--- a/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetTest.php
+++ b/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetTest.php
@@ -54,8 +54,10 @@ public function testShortcutSetMigration() {
    *   The expected shortcut set label.
    * @param int $expected_size
    *   The number of shortcuts expected to be in the set.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $label, $expected_size) {
+  protected function assertEntity(string $id, string $label, int $expected_size): void {
     $shortcut_set = ShortcutSet::load($id);
     $this->assertInstanceOf(ShortcutSetInterface::class, $shortcut_set);
     /** @var \Drupal\shortcut\ShortcutSetInterface $shortcut_set */
diff --git a/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutTest.php b/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutTest.php
index 6e1b4fefe03e..bf9d9bbf1b3b 100644
--- a/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutTest.php
+++ b/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutTest.php
@@ -48,13 +48,15 @@ protected function setUp(): void {
    *   The expected weight of the shortcut.
    * @param string $url
    *   The expected URL of the shortcut.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $title, $weight, $url) {
+  protected function assertEntity(int $id, string $title, int $weight, string $url): void {
     $shortcut = Shortcut::load($id);
     $this->assertInstanceOf(ShortcutInterface::class, $shortcut);
     /** @var \Drupal\shortcut\ShortcutInterface $shortcut */
     $this->assertSame($title, $shortcut->getTitle());
-    $this->assertSame($weight, $shortcut->getWeight());
+    $this->assertSame($weight, (int) $shortcut->getWeight());
     $this->assertSame($url, $shortcut->getUrl()->toString());
   }
 
@@ -63,10 +65,10 @@ protected function assertEntity($id, $title, $weight, $url) {
    */
   public function testShortcutMigration() {
     // Check if the 4 shortcuts were migrated correctly.
-    $this->assertEntity(1, 'Add content', '-20', '/node/add');
-    $this->assertEntity(2, 'Find content', '-19', '/admin/content');
-    $this->assertEntity(3, 'Help', '-49', '/admin/help');
-    $this->assertEntity(4, 'People', '-50', '/admin/people');
+    $this->assertEntity(1, 'Add content', -20, '/node/add');
+    $this->assertEntity(2, 'Find content', -19, '/admin/content');
+    $this->assertEntity(3, 'Help', -49, '/admin/help');
+    $this->assertEntity(4, 'People', -50, '/admin/people');
   }
 
 }
diff --git a/core/modules/statistics/tests/src/Kernel/Migrate/d6/MigrateNodeCounterTest.php b/core/modules/statistics/tests/src/Kernel/Migrate/d6/MigrateNodeCounterTest.php
index 7e31b6a308f9..f42079f74a73 100644
--- a/core/modules/statistics/tests/src/Kernel/Migrate/d6/MigrateNodeCounterTest.php
+++ b/core/modules/statistics/tests/src/Kernel/Migrate/d6/MigrateNodeCounterTest.php
@@ -77,8 +77,10 @@ public function testStatisticsSettings() {
    *   The expected day count.
    * @param int $timestamp
    *   The expected timestamp.
+   *
+   * @internal
    */
-  protected function assertNodeCounter($nid, $total_count, $day_count, $timestamp) {
+  protected function assertNodeCounter(int $nid, int $total_count, int $day_count, int $timestamp): void {
     /** @var \Drupal\statistics\StatisticsViewsResult $statistics */
     $statistics = $this->container->get('statistics.storage.node')->fetchView($nid);
     $this->assertSame($total_count, $statistics->getTotalCount());
diff --git a/core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateNodeCounterTest.php b/core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateNodeCounterTest.php
index f2041654f285..7f8c319831e5 100644
--- a/core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateNodeCounterTest.php
+++ b/core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateNodeCounterTest.php
@@ -68,8 +68,10 @@ public function testStatisticsSettings() {
    *   The expected day count.
    * @param int $timestamp
    *   The expected timestamp.
+   *
+   * @internal
    */
-  protected function assertNodeCounter($nid, $total_count, $day_count, $timestamp) {
+  protected function assertNodeCounter(int $nid, int $total_count, int $day_count, int $timestamp): void {
     /** @var \Drupal\statistics\StatisticsViewsResult $statistics */
     $statistics = $this->container->get('statistics.storage.node')->fetchView($nid);
     $this->assertSame($total_count, $statistics->getTotalCount());
diff --git a/core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php b/core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php
index 402ac866622e..de95fb576168 100644
--- a/core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php
+++ b/core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php
@@ -107,12 +107,14 @@ public function testAJAXRenderError() {
    * the actual command contains additional settings that aren't part of
    * $needle.
    *
-   * @param $haystack
+   * @param array $haystack
    *   An array of rendered Ajax commands returned by the server.
-   * @param $needle
+   * @param array $needle
    *   Array of info we're expecting in one of those commands.
+   *
+   * @internal
    */
-  protected function assertCommand($haystack, $needle) {
+  protected function assertCommand(array $haystack, array $needle): void {
     $found = FALSE;
     foreach ($haystack as $command) {
       // If the command has additional settings that we're not testing for, do
diff --git a/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php b/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
index e624e4c1decf..430883e7cbd1 100644
--- a/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
+++ b/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
@@ -221,16 +221,13 @@ public function testBatchLargePercentage() {
    * Triggers a pass if the texts were found in order in the raw content.
    *
    * @param $texts
-   *   Array of raw strings to look for .
-   * @param $message
-   *   Message to display.
+   *   Array of raw strings to look for.
    *
-   * @return
-   *   TRUE on pass, FALSE on fail.
+   * @internal
    */
-  public function assertBatchMessages($texts, $message) {
+  public function assertBatchMessages(array $texts): void {
     $pattern = '|' . implode('.*', $texts) . '|s';
-    return $this->assertSession()->responseMatches($pattern);
+    $this->assertSession()->responseMatches($pattern);
   }
 
   /**
diff --git a/core/modules/system/tests/src/Functional/Cache/SessionExistsCacheContextTest.php b/core/modules/system/tests/src/Functional/Cache/SessionExistsCacheContextTest.php
index e7561716cbb4..dca3999efc59 100644
--- a/core/modules/system/tests/src/Functional/Cache/SessionExistsCacheContextTest.php
+++ b/core/modules/system/tests/src/Functional/Cache/SessionExistsCacheContextTest.php
@@ -62,8 +62,10 @@ public function testCacheContext() {
 
   /**
    * Asserts whether a session cookie is present on the client or not.
+   *
+   * @internal
    */
-  public function assertSessionCookieOnClient($expected_present) {
+  public function assertSessionCookieOnClient(bool $expected_present): void {
     $this->assertEquals($expected_present, (bool) $this->getSession()->getCookie($this->getSessionName()), 'Session cookie exists.');
   }
 
diff --git a/core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php b/core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php
index 148d025e8dfe..4e064969f8fd 100644
--- a/core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php
+++ b/core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php
@@ -47,8 +47,10 @@ public function testNoJavaScript() {
 
   /**
    * Passes if no JavaScript is found on the page.
+   *
+   * @internal
    */
-  protected function assertNoJavaScript() {
+  protected function assertNoJavaScript(): void {
     // Ensure drupalSettings is not set.
     $settings = $this->getDrupalSettings();
     $this->assertTrue(empty($settings), 'drupalSettings is not set.');
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php b/core/modules/system/tests/src/Functional/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php
index 1ab19c710c1b..8f6a4fcaa34c 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php
@@ -91,8 +91,10 @@ protected function setUp(): void {
    *   An array of tests to run.
    * @param string $handler_name
    *   The name of the entity type selection handler being tested.
+   *
+   * @internal
    */
-  protected function assertReferenceable(array $selection_options, $tests, $handler_name) {
+  protected function assertReferenceable(array $selection_options, array $tests, string $handler_name): void {
     $handler = \Drupal::service('plugin.manager.entity_reference_selection')->getInstance($selection_options);
 
     foreach ($tests as $test) {
diff --git a/core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php b/core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php
index 5be7c331889d..1cd9a8eb7482 100644
--- a/core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php
@@ -79,13 +79,13 @@ public function testConfirmFormWithExternalDestination() {
    *   The url to check for.
    * @param string $message
    *   The assert message.
-   * @param string $group
-   *   The assertion group.
+   *
+   * @internal
    */
-  public function assertCancelLinkUrl(Url $url, $message = '', $group = 'Other') {
+  public function assertCancelLinkUrl(Url $url, string $message = ''): void {
     $links = $this->xpath('//a[@href=:url]', [':url' => $url->toString()]);
     $message = ($message ? $message : new FormattableMarkup('Cancel link with URL %url found.', ['%url' => $url->toString()]));
-    $this->assertTrue(isset($links[0]), $message, $group);
+    $this->assertTrue(isset($links[0]), $message);
   }
 
 }
diff --git a/core/modules/system/tests/src/Functional/Form/FormTest.php b/core/modules/system/tests/src/Functional/Form/FormTest.php
index 860ff8dd0077..7c4eddd2fd38 100644
--- a/core/modules/system/tests/src/Functional/Form/FormTest.php
+++ b/core/modules/system/tests/src/Functional/Form/FormTest.php
@@ -790,8 +790,10 @@ public function testDisabledElements() {
 
   /**
    * Assert that the values submitted to a form matches the default values of the elements.
+   *
+   * @internal
    */
-  public function assertFormValuesDefault($values, $form) {
+  public function assertFormValuesDefault(array $values, array $form): void {
     foreach (Element::children($form) as $key) {
       if (isset($form[$key]['#default_value'])) {
         if (isset($form[$key]['#expected_value'])) {
diff --git a/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php b/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php
index ca1af095f3ba..ecb9e2605470 100644
--- a/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php
+++ b/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php
@@ -41,18 +41,20 @@ protected function stringToHtml($text) {
   /**
    * Helper function to test \Drupal\Core\Mail\MailFormatHelper::htmlToText().
    *
-   * @param $html
+   * @param string $html
    *   The source HTML string to be converted.
-   * @param $text
+   * @param string $text
    *   The expected result of converting $html to text.
-   * @param $message
+   * @param string $message
    *   A text message to display in the assertion message.
-   * @param $allowed_tags
+   * @param array|null $allowed_tags
    *   (optional) An array of allowed tags, or NULL to default to the full
    *   set of tags supported by
    *   \Drupal\Core\Mail\MailFormatHelper::htmlToText().
+   *
+   * @internal
    */
-  protected function assertHtmlToText($html, $text, $message, $allowed_tags = NULL) {
+  protected function assertHtmlToText(string $html, string $text, string $message, ?array $allowed_tags = NULL): void {
     preg_match_all('/<([a-z0-6]+)/', mb_strtolower($html), $matches);
     $tested_tags = implode(', ', array_unique($matches[1]));
     $message .= ' (' . $tested_tags . ')';
diff --git a/core/modules/system/tests/src/Functional/Menu/LocalActionTest.php b/core/modules/system/tests/src/Functional/Menu/LocalActionTest.php
index fcea5966ad92..f4ca2ab86ef8 100644
--- a/core/modules/system/tests/src/Functional/Menu/LocalActionTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/LocalActionTest.php
@@ -70,8 +70,10 @@ public function testLocalAction() {
    *
    * @param array $actions
    *   A list of expected action link titles, keyed by the hrefs.
+   *
+   * @internal
    */
-  protected function assertLocalAction(array $actions) {
+  protected function assertLocalAction(array $actions): void {
     $elements = $this->xpath('//a[contains(@class, :class)]', [
       ':class' => 'button-action',
     ]);
diff --git a/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php b/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php
index 7c74f5aaedf8..c9ddfb282402 100644
--- a/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php
@@ -51,8 +51,10 @@ protected function setUp(): void {
    * @param int $level
    *   (optional) The local tasks level to assert; 0 for primary, 1 for
    *   secondary. Defaults to 0.
+   *
+   * @internal
    */
-  protected function assertLocalTasks(array $routes, $level = 0) {
+  protected function assertLocalTasks(array $routes, int $level = 0): void {
     $elements = $this->xpath('//*[contains(@class, :class)]//a', [
       ':class' => $level == 0 ? 'tabs primary' : 'tabs secondary',
     ]);
@@ -71,15 +73,14 @@ protected function assertLocalTasks(array $routes, $level = 0) {
    * @param string $title
    *   The expected title.
    *
-   * @return bool
-   *   TRUE if the local task exists on the page.
+   * @internal
    */
-  protected function assertLocalTaskAppears($title) {
+  protected function assertLocalTaskAppears(string $title): void {
     // SimpleXML gives us the unescaped text, not the actual escaped markup,
     // so use a pattern instead to check the raw content.
     // This behavior is a bug in libxml, see
     // https://bugs.php.net/bug.php?id=49437.
-    return $this->assertSession()->responseMatches('@<a [^>]*>' . preg_quote($title, '@') . '</a>@');
+    $this->assertSession()->responseMatches('@<a [^>]*>' . preg_quote($title, '@') . '</a>@');
   }
 
   /**
@@ -88,8 +89,10 @@ protected function assertLocalTaskAppears($title) {
    * @param int $level
    *   (optional) The local tasks level to assert; 0 for primary, 1 for
    *   secondary. Defaults to 0.
+   *
+   * @internal
    */
-  protected function assertNoLocalTasks($level = 0) {
+  protected function assertNoLocalTasks(int $level = 0): void {
     $elements = $this->xpath('//*[contains(@class, :class)]//a', [
       ':class' => $level == 0 ? 'tabs primary' : 'tabs secondary',
     ]);
diff --git a/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php b/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php
index 9b6a3cb856f3..11030908cc23 100644
--- a/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php
+++ b/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php
@@ -231,8 +231,10 @@ public function testInstallUninstall() {
    *
    * @param string $name
    *   Name of the module to check.
+   *
+   * @internal
    */
-  protected function assertModuleNotInstalled($name) {
+  protected function assertModuleNotInstalled(string $name): void {
     $this->assertModules([$name], FALSE);
     $this->assertModuleTablesDoNotExist($name);
   }
@@ -242,8 +244,10 @@ protected function assertModuleNotInstalled($name) {
    *
    * @param string $name
    *   Name of the module to check.
+   *
+   * @internal
    */
-  protected function assertModuleSuccessfullyInstalled($name) {
+  protected function assertModuleSuccessfullyInstalled(string $name): void {
     $this->assertModules([$name], TRUE);
     $this->assertModuleTablesExist($name);
     $this->assertModuleConfig($name);
@@ -257,8 +261,10 @@ protected function assertModuleSuccessfullyInstalled($name) {
    * @param string $package
    *   (optional) The package of the module to uninstall. Defaults
    *   to 'Core'.
+   *
+   * @internal
    */
-  protected function assertSuccessfulUninstall($module, $package = 'Core') {
+  protected function assertSuccessfulUninstall(string $module, string $package = 'Core'): void {
     $edit = [];
     $edit['uninstall[' . $module . ']'] = TRUE;
     $this->drupalGet('admin/modules/uninstall');
@@ -286,8 +292,10 @@ protected function assertSuccessfulUninstall($module, $package = 'Core') {
    *
    * @param string $module
    *   The module that got installed.
+   *
+   * @internal
    */
-  protected function assertInstallModuleUpdates($module) {
+  protected function assertInstallModuleUpdates(string $module): void {
     /** @var \Drupal\Core\Update\UpdateRegistry $post_update_registry */
     $post_update_registry = \Drupal::service('update.post_update_registry');
     $all_update_functions = $post_update_registry->getPendingUpdateFunctions();
@@ -323,8 +331,10 @@ protected function assertInstallModuleUpdates($module) {
    *
    * @param string $module
    *   The module that got installed.
+   *
+   * @internal
    */
-  protected function assertUninstallModuleUpdates($module) {
+  protected function assertUninstallModuleUpdates(string $module): void {
     /** @var \Drupal\Core\Update\UpdateRegistry $post_update_registry */
     $post_update_registry = \Drupal::service('update.post_update_registry');
     $all_update_functions = $post_update_registry->getPendingUpdateFunctions();
@@ -350,8 +360,10 @@ protected function assertUninstallModuleUpdates($module) {
    *   Machine name of the module to verify.
    * @param string $name
    *   Human-readable name of the module to verify.
+   *
+   * @internal
    */
-  protected function assertHelp($module, $name) {
+  protected function assertHelp(string $module, string $name): void {
     $this->drupalGet('admin/help/' . $module);
     $this->assertSession()->statusCodeEquals(200);
     $this->assertSession()->pageTextContains($name . ' module');
diff --git a/core/modules/system/tests/src/Functional/Pager/PagerTest.php b/core/modules/system/tests/src/Functional/Pager/PagerTest.php
index cc570726c37b..d6f09f2174bb 100644
--- a/core/modules/system/tests/src/Functional/Pager/PagerTest.php
+++ b/core/modules/system/tests/src/Functional/Pager/PagerTest.php
@@ -216,8 +216,10 @@ public function testPagerEllipsis() {
    *
    * @param int $current_page
    *   The current pager page the internal browser is on.
+   *
+   * @internal
    */
-  protected function assertPagerItems($current_page) {
+  protected function assertPagerItems(int $current_page): void {
     $elements = $this->xpath('//ul[contains(@class, :class)]/li', [':class' => 'pager__items']);
     $this->assertNotEmpty($elements, 'Pager found.');
 
@@ -319,8 +321,10 @@ protected function assertPagerItems($current_page) {
    *   The class to assert.
    * @param string $message
    *   (optional) A verbose message to output.
+   *
+   * @internal
    */
-  protected function assertClass(NodeElement $element, $class, $message = NULL) {
+  protected function assertClass(NodeElement $element, string $class, string $message = NULL): void {
     if (!isset($message)) {
       $message = "Class .$class found.";
     }
@@ -336,8 +340,10 @@ protected function assertClass(NodeElement $element, $class, $message = NULL) {
    *   The class to assert.
    * @param string $message
    *   (optional) A verbose message to output.
+   *
+   * @internal
    */
-  protected function assertNoClass(NodeElement $element, $class, $message = NULL) {
+  protected function assertNoClass(NodeElement $element, string $class, string $message = NULL): void {
     if (!isset($message)) {
       $message = "Class .$class not found.";
     }
diff --git a/core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php b/core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php
index 9921fe04a900..a66e3d023260 100644
--- a/core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php
+++ b/core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php
@@ -101,8 +101,10 @@ public function testRenderCachedBlock() {
 
   /**
    * Helper function to make assertions about added HTTP headers.
+   *
+   * @internal
    */
-  protected function assertTeapotHeaders() {
+  protected function assertTeapotHeaders(): void {
     $this->assertSession()->responseHeaderEquals('X-Test-Teapot', 'Teapot Mode Active');
     $this->assertSession()->responseHeaderEquals('X-Test-Teapot-Replace', 'Teapot replaced');
     $this->assertSession()->responseHeaderEquals('X-Test-Teapot-No-Replace', 'This value is not replaced');
@@ -110,8 +112,10 @@ protected function assertTeapotHeaders() {
 
   /**
    * Helper function to make assertions about the presence of an RSS feed.
+   *
+   * @internal
    */
-  protected function assertFeed() {
+  protected function assertFeed(): void {
     // Discover the DOM element for the feed link.
     $test_meta = $this->xpath('//head/link[@href="test://url"]');
     $this->assertCount(1, $test_meta, 'Link has URL.');
@@ -135,8 +139,10 @@ protected function assertFeed() {
 
   /**
    * Helper function to make assertions about HTML head elements.
+   *
+   * @internal
    */
-  protected function assertHead() {
+  protected function assertHead(): void {
     // Discover the DOM element for the meta link.
     $test_meta = $this->xpath('//head/meta[@test-attribute="testvalue"]');
     $this->assertCount(1, $test_meta, 'There\'s only one test attribute.');
diff --git a/core/modules/system/tests/src/Functional/SecurityAdvisories/SecurityAdvisoryTest.php b/core/modules/system/tests/src/Functional/SecurityAdvisories/SecurityAdvisoryTest.php
index 4d6cb3928cc6..c96f119d5f41 100644
--- a/core/modules/system/tests/src/Functional/SecurityAdvisories/SecurityAdvisoryTest.php
+++ b/core/modules/system/tests/src/Functional/SecurityAdvisories/SecurityAdvisoryTest.php
@@ -217,6 +217,8 @@ public function testPsa(): void {
    *   The expected links' text.
    * @param int $error_or_warning
    *   Whether the links are a warning or an error. Should be one of the REQUIREMENT_* constants.
+   *
+   * @internal
    */
   private function assertAdminPageLinks(array $expected_link_texts, int $error_or_warning): void {
     $assert = $this->assertSession();
@@ -241,6 +243,8 @@ private function assertAdminPageLinks(array $expected_link_texts, int $error_or_
    *   The expected links' text.
    * @param int $error_or_warning
    *   Whether the links are a warning or an error. Should be one of the REQUIREMENT_* constants.
+   *
+   * @internal
    */
   private function assertStatusReportLinks(array $expected_link_texts, int $error_or_warning): void {
     $this->drupalGet(Url::fromRoute('system.status'));
@@ -260,6 +264,8 @@ private function assertStatusReportLinks(array $expected_link_texts, int $error_
    *   The advisory links.
    * @param array $routes
    *   The routes to test.
+   *
+   * @internal
    */
   private function assertAdvisoriesNotDisplayed(array $links, array $routes = ['system.status', 'system.admin']): void {
     foreach ($routes as $route) {
@@ -281,6 +287,8 @@ private function assertAdvisoriesNotDisplayed(array $links, array $routes = ['sy
    *   The expected error messages.
    *
    * @see \Drupal\advisory_feed_test\TestSystemLoggerChannel::log()
+   *
+   * @internal
    */
   protected function assertServiceAdvisoryLoggedErrors(array $expected_messages): void {
     $state = $this->container->get('state');
diff --git a/core/modules/system/tests/src/Functional/Session/SessionAuthenticationTest.php b/core/modules/system/tests/src/Functional/Session/SessionAuthenticationTest.php
index 55219cd376f5..5b7c31c92f87 100644
--- a/core/modules/system/tests/src/Functional/Session/SessionAuthenticationTest.php
+++ b/core/modules/system/tests/src/Functional/Session/SessionAuthenticationTest.php
@@ -103,8 +103,10 @@ public function testBasicAuthSession() {
    *   A response object containing the session values and the user ID.
    * @param string $expected
    *   The expected session value.
+   *
+   * @internal
    */
-  protected function assertSessionData($response, $expected) {
+  protected function assertSessionData(string $response, string $expected): void {
     $response = json_decode($response, TRUE);
     $this->assertEquals(['test_value' => $expected], $response['session'], 'The session data matches the expected value.');
 
diff --git a/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php b/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php
index 0b679ad373e5..8b123f0882a7 100644
--- a/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php
+++ b/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php
@@ -254,12 +254,14 @@ protected function getPathFromLocationHeader(ResponseInterface $response, $https
   /**
    * Tests that there exists a session with two specific session IDs.
    *
-   * @param $sid
+   * @param string $sid
    *   The insecure session ID to search for.
-   * @param $assertion_text
+   * @param string $assertion_text
    *   The text to display when we perform the assertion.
+   *
+   * @internal
    */
-  protected function assertSessionIds($sid, $assertion_text) {
+  protected function assertSessionIds(string $sid, string $assertion_text): void {
     $this->assertNotEmpty(\Drupal::database()->select('sessions', 's')->fields('s', ['timestamp'])->condition('sid', Crypt::hashBase64($sid))->execute()->fetchField(), $assertion_text);
   }
 
diff --git a/core/modules/system/tests/src/Functional/Session/SessionTest.php b/core/modules/system/tests/src/Functional/Session/SessionTest.php
index b07b8cb55b97..10c8f55b4704 100644
--- a/core/modules/system/tests/src/Functional/Session/SessionTest.php
+++ b/core/modules/system/tests/src/Functional/Session/SessionTest.php
@@ -372,8 +372,10 @@ public function sessionReset() {
 
   /**
    * Assert whether the SimpleTest browser sent a session cookie.
+   *
+   * @internal
    */
-  public function assertSessionCookie($sent) {
+  public function assertSessionCookie(bool $sent): void {
     if ($sent) {
       $this->assertNotEmpty($this->getSessionCookies()->count(), 'Session cookie was sent.');
     }
@@ -384,8 +386,10 @@ public function assertSessionCookie($sent) {
 
   /**
    * Assert whether $_SESSION is empty at the beginning of the request.
+   *
+   * @internal
    */
-  public function assertSessionEmpty($empty) {
+  public function assertSessionEmpty(bool $empty): void {
     if ($empty) {
       $this->assertSession()->responseHeaderEquals('X-Session-Empty', '1');
     }
diff --git a/core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php b/core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php
index 5d97125dd57c..26daf6ec1c9d 100644
--- a/core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php
+++ b/core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php
@@ -150,16 +150,20 @@ public function testExceptionHandler() {
 
   /**
    * Helper function: assert that the error message is found.
+   *
+   * @internal
    */
-  public function assertErrorMessage(array $error) {
+  public function assertErrorMessage(array $error): void {
     $message = new FormattableMarkup('%type: @message in %function (line ', $error);
     $this->assertSession()->responseContains($message);
   }
 
   /**
    * Helper function: assert that the error message is not found.
+   *
+   * @internal
    */
-  public function assertNoErrorMessage(array $error) {
+  public function assertNoErrorMessage(array $error): void {
     $message = new FormattableMarkup('%type: @message in %function (line ', $error);
     $this->assertSession()->responseNotContains($message);
   }
@@ -169,8 +173,10 @@ public function assertNoErrorMessage(array $error) {
    *
    * Ensures that no messages div exists, which proves that no messages were
    * generated by the error handler, not even an empty one.
+   *
+   * @internal
    */
-  protected function assertNoMessages() {
+  protected function assertNoMessages(): void {
     $this->assertSession()->elementNotExists('xpath', '//div[contains(@class, "messages")]');
   }
 
diff --git a/core/modules/system/tests/src/Functional/System/HtaccessTest.php b/core/modules/system/tests/src/Functional/System/HtaccessTest.php
index 092f57ac7020..e932fa3b348c 100644
--- a/core/modules/system/tests/src/Functional/System/HtaccessTest.php
+++ b/core/modules/system/tests/src/Functional/System/HtaccessTest.php
@@ -139,8 +139,10 @@ public function testFileAccess() {
    *   Path to file. Without leading slash.
    * @param int $response_code
    *   The expected response code. For example: 200, 403 or 404.
+   *
+   * @internal
    */
-  protected function assertFileAccess($path, $response_code) {
+  protected function assertFileAccess(string $path, int $response_code): void {
     $this->assertFileExists(\Drupal::root() . '/' . $path);
     $this->drupalGet($path);
     $this->assertEquals($response_code, $this->getSession()->getStatusCode(), "Response code to $path should be $response_code");
diff --git a/core/modules/system/tests/src/Functional/System/ThemeTest.php b/core/modules/system/tests/src/Functional/System/ThemeTest.php
index ca1c94eaf14a..6859bf697ecd 100644
--- a/core/modules/system/tests/src/Functional/System/ThemeTest.php
+++ b/core/modules/system/tests/src/Functional/System/ThemeTest.php
@@ -509,7 +509,7 @@ public function testThemeSettingsNoLogoNoFavicon() {
    * @param string $expected_text
    *   The expected incompatibility text.
    */
-  private function assertThemeIncompatibleText($theme_name, $expected_text) {
+  private function assertThemeIncompatibleText(string $theme_name, string $expected_text): void {
     $this->assertSession()->elementExists('css', ".theme-info:contains(\"$theme_name\") .incompatible:contains(\"$expected_text\")");
   }
 
diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php
index 39fce07d4c25..98388dbd1462 100644
--- a/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php
@@ -285,8 +285,10 @@ public function providerTestThemeInstallWithModuleDependencies() {
    *   The modules listed as being required to install the theme.
    * @param string $theme_name
    *   The name of the theme.
+   *
+   * @internal
    */
-  protected function assertUninstallableTheme(array $expected_requires_list_items, $theme_name) {
+  protected function assertUninstallableTheme(array $expected_requires_list_items, string $theme_name): void {
     $theme_container = $this->getSession()->getPage()->find('css', "h3:contains(\"$theme_name\")")->getParent();
     $requires_list_items = $theme_container->findAll('css', '.theme-info__requires li');
     $this->assertSameSize($expected_requires_list_items, $requires_list_items);
diff --git a/core/modules/system/tests/src/Functional/Theme/TwigRegistryLoaderTest.php b/core/modules/system/tests/src/Functional/Theme/TwigRegistryLoaderTest.php
index e123f7e05153..d2eab6684343 100644
--- a/core/modules/system/tests/src/Functional/Theme/TwigRegistryLoaderTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/TwigRegistryLoaderTest.php
@@ -37,8 +37,10 @@ protected function setUp(): void {
 
   /**
    * Checks to see if a value is a Twig template.
+   *
+   * @internal
    */
-  public function assertTwigTemplate($value, $message = '') {
+  public function assertTwigTemplate($value, string $message = ''): void {
     $this->assertInstanceOf(TemplateWrapper::class, $value, $message);
   }
 
diff --git a/core/modules/system/tests/src/Functional/Theme/TwigTransTest.php b/core/modules/system/tests/src/Functional/Theme/TwigTransTest.php
index cb292abf31d7..35078dc72716 100644
--- a/core/modules/system/tests/src/Functional/Theme/TwigTransTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/TwigTransTest.php
@@ -123,8 +123,10 @@ public function testEmptyTwigTransTags() {
 
   /**
    * Asserts Twig trans tags.
+   *
+   * @internal
    */
-  protected function assertTwigTransTags() {
+  protected function assertTwigTransTags(): void {
     // Assert that {% trans "Hello sun." %} is translated correctly.
     $this->assertSession()->pageTextContains('OH HAI SUNZ');
 
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
index c6b31078c247..63286e8fb772 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
@@ -803,8 +803,10 @@ public function getSystemSchema() {
    *   The extension type, either 'module' or 'theme'.
    * @param string $extension_machine_name
    *   The extension machine name.
+   *
+   * @internal
    */
-  protected function assertInstalledExtensionConfig($extension_type, $extension_machine_name) {
+  protected function assertInstalledExtensionConfig(string $extension_type, string $extension_machine_name): void {
     $extension_config = $this->container->get('config.factory')->getEditable('core.extension');
     $this->assertSame(0, $extension_config->get("$extension_type.$extension_machine_name"));
   }
@@ -820,8 +822,10 @@ protected function assertInstalledExtensionConfig($extension_type, $extension_ma
    *   The extension machine name.
    *
    * @throws \Behat\Mink\Exception\ResponseTextException
+   *
+   * @internal
    */
-  protected function assertUpdateWithNoError($unexpected_error_text, $extension_type, $extension_machine_name) {
+  protected function assertUpdateWithNoError(string $unexpected_error_text, string $extension_type, string $extension_machine_name): void {
     $assert_session = $this->assertSession();
     $this->drupalGet($this->statusReportUrl);
     $this->assertSession()->pageTextNotContains($unexpected_error_text);
@@ -845,8 +849,10 @@ protected function assertUpdateWithNoError($unexpected_error_text, $extension_ty
    *
    * @throws \Behat\Mink\Exception\ExpectationException
    * @throws \Behat\Mink\Exception\ResponseTextException
+   *
+   * @internal
    */
-  protected function assertErrorOnUpdate($expected_error_text, $extension_type, $extension_machine_name) {
+  protected function assertErrorOnUpdate(string $expected_error_text, string $extension_type, string $extension_machine_name): void {
     $assert_session = $this->assertSession();
     $this->drupalGet($this->statusReportUrl);
     $this->assertSession()->pageTextContains($expected_error_text);
diff --git a/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php b/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php
index 348c11addef1..c4f6a047aaac 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php
@@ -150,8 +150,10 @@ public function testNarrowWidth() {
    *   The index of the link to test.
    * @param string $position
    *   The position of the dialog to test.
+   *
+   * @internal
    */
-  protected function assertOffCanvasDialog($link_index, $position) {
+  protected function assertOffCanvasDialog(int $link_index, string $position): void {
     $page = $this->getSession()->getPage();
     $web_assert = $this->assertSession();
     $link_text = "Open $position panel $link_index";
diff --git a/core/modules/system/tests/src/Kernel/Common/FormElementsRenderTest.php b/core/modules/system/tests/src/Kernel/Common/FormElementsRenderTest.php
index 9c8330455629..f5f79c1d2a24 100644
--- a/core/modules/system/tests/src/Kernel/Common/FormElementsRenderTest.php
+++ b/core/modules/system/tests/src/Kernel/Common/FormElementsRenderTest.php
@@ -139,8 +139,10 @@ public function testDrupalRenderFormElements() {
 
   /**
    * Tests that elements are rendered properly.
+   *
+   * @internal
    */
-  protected function assertRenderedElement(array $element, $xpath, array $xpath_args = []) {
+  protected function assertRenderedElement(array $element, string $xpath, array $xpath_args = []): void {
     $this->render($element);
 
     $xpath = $this->buildXPathQuery($xpath, $xpath_args);
diff --git a/core/modules/system/tests/src/Kernel/Common/PageRenderTest.php b/core/modules/system/tests/src/Kernel/Common/PageRenderTest.php
index 6c4e263ccf00..a7842b480a87 100644
--- a/core/modules/system/tests/src/Kernel/Common/PageRenderTest.php
+++ b/core/modules/system/tests/src/Kernel/Common/PageRenderTest.php
@@ -36,8 +36,10 @@ public function testHookPageAlter() {
    *   The module whose invalid logic in its hooks to enable.
    * @param string $hook
    *   The page render hook to assert expected exceptions for.
+   *
+   * @internal
    */
-  public function assertPageRenderHookExceptions($module, $hook) {
+  public function assertPageRenderHookExceptions(string $module, string $hook): void {
     $html_renderer = \Drupal::getContainer()->get('main_content_renderer.html');
 
     // Assert a valid hook implementation doesn't trigger an exception.
diff --git a/core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php b/core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
index 81356bb92264..a970c30257c1 100644
--- a/core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
+++ b/core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
@@ -254,8 +254,10 @@ protected function checkSinglePluginConfigSync(EntityWithPluginCollectionInterfa
    *   The original data stored in the config object.
    * @param array $custom_data
    *   The new data to store in the config object.
+   *
+   * @internal
    */
-  public function assertConfigUpdateImport($name, $original_data, $custom_data) {
+  public function assertConfigUpdateImport(string $name, array $original_data, array $custom_data): void {
     $this->container->get('config.storage.sync')->write($name, $custom_data);
 
     // Verify the active configuration still returns the default values.
diff --git a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
index ff33361d4f45..8ca75e106582 100644
--- a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
+++ b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
@@ -58,10 +58,12 @@ public function testModuleList() {
    *
    * @param array $expected_values
    *   The expected values, sorted by weight and module name.
-   * @param $condition
+   * @param string $condition
    *   The condition being tested, such as 'After adding a module'.
+   *
+   * @internal
    */
-  protected function assertModuleList(array $expected_values, $condition) {
+  protected function assertModuleList(array $expected_values, string $condition): void {
     $expected_values = array_values(array_unique($expected_values));
     $enabled_modules = array_keys($this->container->get('module_handler')->getModuleList());
     $this->assertEquals($expected_values, $enabled_modules, new FormattableMarkup('@condition: extension handler returns correct results', ['@condition' => $condition]));
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php
index b0cd4ff2a906..d4aac6d578ab 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php
@@ -24,7 +24,7 @@ protected function setUp(): void {
   /**
    * Asserts various aspects of a menu.
    *
-   * @param $id
+   * @param string $id
    *   The menu ID.
    * @param string $language
    *   The menu language.
@@ -32,8 +32,10 @@ protected function setUp(): void {
    *   The menu label.
    * @param $description
    *   The menu description.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $language, $label, $description) {
+  protected function assertEntity(string $id, string $language, string $label, string $description): void {
     $navigation_menu = Menu::load($id);
     $this->assertSame($id, $navigation_menu->id());
     $this->assertSame($language, $navigation_menu->language()->getId());
diff --git a/core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php b/core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php
index 294b90dbb281..70a11c4d63b3 100644
--- a/core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php
+++ b/core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php
@@ -730,6 +730,8 @@ protected function setTestFeedResponses(array $responses): void {
    *
    * @param string[] $expected_messages
    *   The expected error messages.
+   *
+   * @internal
    */
   protected function assertServiceAdvisoryLoggedErrors(array $expected_messages): void {
     $this->assertSame($expected_messages, $this->logErrorMessages);
diff --git a/core/modules/system/tests/src/Kernel/Theme/TwigNamespaceTest.php b/core/modules/system/tests/src/Kernel/Theme/TwigNamespaceTest.php
index 40c476f0b5a3..f758ddd287c9 100644
--- a/core/modules/system/tests/src/Kernel/Theme/TwigNamespaceTest.php
+++ b/core/modules/system/tests/src/Kernel/Theme/TwigNamespaceTest.php
@@ -37,8 +37,10 @@ protected function setUp(): void {
 
   /**
    * Checks to see if a value is a twig template.
+   *
+   * @internal
    */
-  public function assertTwigTemplate($value, $message = '') {
+  public function assertTwigTemplate($value, string $message = ''): void {
     $this->assertInstanceOf(TemplateWrapper::class, $value, $message);
   }
 
diff --git a/core/modules/taxonomy/tests/src/Functional/TermAccessTest.php b/core/modules/taxonomy/tests/src/Functional/TermAccessTest.php
index 39a4c5d3c877..a07f0bd69c60 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermAccessTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermAccessTest.php
@@ -110,14 +110,16 @@ public function testTermAccess() {
    *
    * @param \Drupal\taxonomy\TermInterface $term
    *   A taxonomy term entity.
-   * @param $access_operation
+   * @param string $access_operation
    *   The entity operation, e.g. 'view', 'edit', 'delete', etc.
    * @param bool $access_allowed
    *   Whether the current use has access to the given operation or not.
    * @param string $access_reason
    *   (optional) The reason of the access result.
+   *
+   * @internal
    */
-  protected function assertTermAccess(TermInterface $term, $access_operation, $access_allowed, $access_reason = '') {
+  protected function assertTermAccess(TermInterface $term, string $access_operation, bool $access_allowed, string $access_reason = ''): void {
     $access_result = $term->access($access_operation, NULL, TRUE);
     $this->assertSame($access_allowed, $access_result->isAllowed());
 
diff --git a/core/modules/taxonomy/tests/src/Functional/TermParentsTest.php b/core/modules/taxonomy/tests/src/Functional/TermParentsTest.php
index 88d3033cf942..ef0d06ff245e 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermParentsTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermParentsTest.php
@@ -282,8 +282,10 @@ protected function createTerm($name, array $parent_ids = []) {
    * @param bool $selected
    *   (optional) Whether or not the option should be selected. Defaults to
    *   FALSE.
+   *
+   * @internal
    */
-  protected function assertParentOption($option, $selected = FALSE) {
+  protected function assertParentOption(string $option, bool $selected = FALSE): void {
     $option = $this->assertSession()->optionExists('Parent terms', $option);
     if ($selected) {
       $this->assertTrue($option->hasAttribute('selected'));
@@ -298,8 +300,10 @@ protected function assertParentOption($option, $selected = FALSE) {
    *
    * @param \Drupal\taxonomy\TermInterface $term
    *   The term to check.
+   *
+   * @internal
    */
-  protected function assertParentsUnchanged(TermInterface $term) {
+  protected function assertParentsUnchanged(TermInterface $term): void {
     $saved_term = $this->termStorage->load($term->id());
 
     $expected = $term->get('parent')->getValue();
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/RelationshipNodeTermDataTest.php b/core/modules/taxonomy/tests/src/Functional/Views/RelationshipNodeTermDataTest.php
index 61f90cb5013e..e79e77fc7705 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/RelationshipNodeTermDataTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/RelationshipNodeTermDataTest.php
@@ -94,8 +94,10 @@ public function testTag() {
    *   The View to check for the term access tag.
    * @param bool $hasTag
    *   The expected existence of taxonomy_term_access tag.
+   *
+   * @internal
    */
-  protected function assertQueriesTermAccessTag(ViewExecutable $view, $hasTag) {
+  protected function assertQueriesTermAccessTag(ViewExecutable $view, bool $hasTag): void {
     $main_query = $view->build_info['query'];
     $count_query = $view->build_info['count_query'];
 
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php
index dafa38e2241c..2f47bae8fb72 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php
@@ -146,8 +146,10 @@ public function testFilters() {
    *   that translation should be shown on the given page.
    * @param string $message
    *   Message suffix to display.
+   *
+   * @internal
    */
-  protected function assertPageCounts($path, $counts, $message) {
+  protected function assertPageCounts(string $path, array $counts, string $message): void {
     // Get the text of the page.
     $this->drupalGet($path);
     $text = $this->getTextContent();
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermFilterDepthTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermFilterDepthTest.php
index 79f9829555e8..481a4c69d336 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermFilterDepthTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermFilterDepthTest.php
@@ -137,8 +137,10 @@ public function testTermWithDepthFilter() {
    *   The depth to search.
    * @param array $expected
    *   The expected views result.
+   *
+   * @internal
    */
-  protected function assertTermWithDepthResult($tid, $depth, array $expected) {
+  protected function assertTermWithDepthResult(int $tid, int $depth, array $expected): void {
     $this->view->destroy();
     $this->view->initDisplay();
     $filters = $this->view->displayHandlers->get('default')
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermLocalizedTranslationTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermLocalizedTranslationTest.php
index 3b66a94fb445..c2afbe1f336c 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermLocalizedTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermLocalizedTranslationTest.php
@@ -60,9 +60,9 @@ protected function setUp(): void {
    *   The label the migrated entity should have.
    * @param string $expected_vid
    *   The parent vocabulary the migrated entity should have.
-   * @param string $expected_description
+   * @param string|null $expected_description
    *   The description the migrated entity should have.
-   * @param string $expected_format
+   * @param string|null $expected_format
    *   The format the migrated entity should have.
    * @param int $expected_weight
    *   The weight the migrated entity should have.
@@ -72,8 +72,10 @@ protected function setUp(): void {
    *   The value the migrated entity field should have.
    * @param int $expected_term_reference_tid
    *   The term reference ID the migrated entity field should have.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $expected_language, $expected_label, $expected_vid, $expected_description = '', $expected_format = NULL, $expected_weight = 0, array $expected_parents = [], $expected_field_integer_value = NULL, $expected_term_reference_tid = NULL) {
+  protected function assertEntity(int $id, string $expected_language, string $expected_label, string $expected_vid, ?string $expected_description = '', ?string $expected_format = NULL, int $expected_weight = 0, array $expected_parents = [], int $expected_field_integer_value = NULL, int $expected_term_reference_tid = NULL): void {
     /** @var \Drupal\taxonomy\TermInterface $entity */
     $entity = Term::load($id);
     $this->assertInstanceOf(TermInterface::class, $entity);
@@ -82,7 +84,7 @@ protected function assertEntity($id, $expected_language, $expected_label, $expec
     $this->assertSame($expected_vid, $entity->bundle());
     $this->assertSame($expected_description, $entity->getDescription());
     $this->assertSame($expected_format, $entity->getFormat());
-    $this->assertSame($expected_weight, $entity->getWeight());
+    $this->assertSame($expected_weight, (int) $entity->getWeight());
     $this->assertHierarchy($expected_vid, $id, $expected_parents);
   }
 
@@ -95,8 +97,10 @@ protected function assertEntity($id, $expected_language, $expected_label, $expec
    *   ID of the term to check.
    * @param array $parent_ids
    *   The expected parent term IDs.
+   *
+   * @internal
    */
-  protected function assertHierarchy($vid, $tid, array $parent_ids) {
+  protected function assertHierarchy(string $vid, int $tid, array $parent_ids): void {
     if (!isset($this->treeData[$vid])) {
       $tree = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree($vid);
       $this->treeData[$vid] = [];
@@ -114,8 +118,8 @@ protected function assertHierarchy($vid, $tid, array $parent_ids) {
    * Tests the Drupal 6 i18n localized taxonomy term to Drupal 8 migration.
    */
   public function testTranslatedLocalizedTaxonomyTerms() {
-    $this->assertEntity(14, 'en', 'Talos IV', 'vocabulary_name_much_longer_th', 'The home of Captain Christopher Pike.', NULL, '0', []);
-    $this->assertEntity(15, 'en', 'Vulcan', 'vocabulary_name_much_longer_th', NULL, NULL, '0', []);
+    $this->assertEntity(14, 'en', 'Talos IV', 'vocabulary_name_much_longer_th', 'The home of Captain Christopher Pike.', NULL, 0, []);
+    $this->assertEntity(15, 'en', 'Vulcan', 'vocabulary_name_much_longer_th', NULL, NULL, 0, []);
 
     /** @var \Drupal\taxonomy\TermInterface $entity */
     $entity = Term::load(14);
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php
index e9f7f89f8fd5..39c91d517bba 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php
@@ -56,7 +56,7 @@ protected function setUp(): void {
   /**
    * Validate a migrated term contains the expected values.
    *
-   * @param $id
+   * @param int $id
    *   Entity ID to load and check.
    * @param string $expected_language
    *   The language code for this term.
@@ -64,9 +64,9 @@ protected function setUp(): void {
    *   The label the migrated entity should have.
    * @param $expected_vid
    *   The parent vocabulary the migrated entity should have.
-   * @param string $expected_description
+   * @param string|null $expected_description
    *   The description the migrated entity should have.
-   * @param string $expected_format
+   * @param string|null $expected_format
    *   The format the migrated entity should have.
    * @param int $expected_weight
    *   The weight the migrated entity should have.
@@ -78,8 +78,10 @@ protected function setUp(): void {
    *   The term reference id the migrated entity field should have.
    * @param bool $expected_container_flag
    *   The term should be a container entity.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $expected_language, $expected_label, $expected_vid, $expected_description = '', $expected_format = NULL, $expected_weight = 0, array $expected_parents = [], $expected_field_integer_value = NULL, $expected_term_reference_tid = NULL, $expected_container_flag = 0) {
+  protected function assertEntity(int $id, string $expected_language, string $expected_label, string $expected_vid, ?string $expected_description = '', ?string $expected_format = NULL, int $expected_weight = 0, array $expected_parents = [], int $expected_field_integer_value = NULL, int $expected_term_reference_tid = NULL, bool $expected_container_flag = FALSE): void {
     /** @var \Drupal\taxonomy\TermInterface $entity */
     $entity = Term::load($id);
     $this->assertInstanceOf(TermInterface::class, $entity);
@@ -88,7 +90,7 @@ protected function assertEntity($id, $expected_language, $expected_label, $expec
     $this->assertEquals($expected_vid, $entity->bundle());
     $this->assertEquals($expected_description, $entity->getDescription());
     $this->assertEquals($expected_format, $entity->getFormat());
-    $this->assertEquals($expected_weight, $entity->getWeight());
+    $this->assertEquals($expected_weight, (int) $entity->getWeight());
     $this->assertEquals($expected_parents, $this->getParentIDs($id));
     $this->assertHierarchy($expected_vid, $id, $expected_parents);
     if (!is_null($expected_field_integer_value)) {
@@ -228,7 +230,7 @@ protected function getParentIDs($tid) {
    * @param array $parent_ids
    *   The expected parent term IDs.
    */
-  protected function assertHierarchy($vid, $tid, array $parent_ids) {
+  protected function assertHierarchy(string $vid, int $tid, array $parent_ids): void {
     if (!isset($this->treeData[$vid])) {
       $tree = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree($vid);
       $this->treeData[$vid] = [];
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php
index c85a52f6d1db..bd37bf6e319d 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php
@@ -71,9 +71,9 @@ protected function setUp(): void {
    *   The label the migrated entity should have.
    * @param string $expected_vid
    *   The parent vocabulary the migrated entity should have.
-   * @param string $expected_description
+   * @param string|null $expected_description
    *   The description the migrated entity should have.
-   * @param string $expected_format
+   * @param string|null $expected_format
    *   The format the migrated entity should have.
    * @param int $expected_weight
    *   The weight the migrated entity should have.
@@ -83,8 +83,10 @@ protected function setUp(): void {
    *   The value the migrated entity field should have.
    * @param int $expected_term_reference_tid
    *   The term reference ID the migrated entity field should have.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $expected_language, $expected_label, $expected_vid, $expected_description = '', $expected_format = NULL, $expected_weight = 0, array $expected_parents = [], $expected_field_integer_value = NULL, $expected_term_reference_tid = NULL) {
+  protected function assertEntity(int $id, string $expected_language, string $expected_label, string $expected_vid, ?string $expected_description = '', ?string $expected_format = NULL, int $expected_weight = 0, array $expected_parents = [], int $expected_field_integer_value = NULL, int $expected_term_reference_tid = NULL): void {
     /** @var \Drupal\taxonomy\TermInterface $entity */
     $entity = Term::load($id);
     $this->assertInstanceOf(TermInterface::class, $entity);
@@ -93,7 +95,7 @@ protected function assertEntity($id, $expected_language, $expected_label, $expec
     $this->assertSame($expected_vid, $entity->bundle());
     $this->assertSame($expected_description, $entity->getDescription());
     $this->assertSame($expected_format, $entity->getFormat());
-    $this->assertSame($expected_weight, $entity->getWeight());
+    $this->assertSame($expected_weight, (int) $entity->getWeight());
     $this->assertHierarchy($expected_vid, $id, $expected_parents);
   }
 
@@ -106,8 +108,10 @@ protected function assertEntity($id, $expected_language, $expected_label, $expec
    *   ID of the term to check.
    * @param array $parent_ids
    *   The expected parent term IDs.
+   *
+   * @internal
    */
-  protected function assertHierarchy($vid, $tid, array $parent_ids) {
+  protected function assertHierarchy(string $vid, int $tid, array $parent_ids): void {
     if (!isset($this->treeData[$vid])) {
       $tree = \Drupal::entityTypeManager()
         ->getStorage('taxonomy_term')
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php
index ef8d3eda6df3..979d5b5ac1fb 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php
@@ -29,7 +29,7 @@ protected function setUp(): void {
   /**
    * Validate a migrated vocabulary contains the expected values.
    *
-   * @param $id
+   * @param string $id
    *   Entity ID to load and check.
    * @param $expected_label
    *   The label the migrated entity should have.
@@ -37,14 +37,16 @@ protected function setUp(): void {
    *   The description the migrated entity should have.
    * @param $expected_weight
    *   The weight the migrated entity should have.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $expected_label, $expected_description, $expected_weight) {
+  protected function assertEntity(string $id, string $expected_label, string $expected_description, int $expected_weight): void {
     /** @var \Drupal\taxonomy\VocabularyInterface $entity */
     $entity = Vocabulary::load($id);
     $this->assertInstanceOf(VocabularyInterface::class, $entity);
     $this->assertSame($expected_label, $entity->label());
     $this->assertSame($expected_description, $entity->getDescription());
-    $this->assertSame($expected_weight, $entity->get('weight'));
+    $this->assertSame($expected_weight, (int) $entity->get('weight'));
   }
 
   /**
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTermLocalizedTranslationTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTermLocalizedTranslationTest.php
index 5c011bf93680..fb0d80b1b5ac 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTermLocalizedTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTermLocalizedTranslationTest.php
@@ -68,8 +68,10 @@ protected function setUp(): void {
    *   The value the migrated entity field should have.
    * @param int $expected_term_reference_tid
    *   The term reference ID the migrated entity field should have.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $expected_language, $expected_label, $expected_vid, $expected_description = '', $expected_format = NULL, $expected_weight = 0, array $expected_parents = [], $expected_field_integer_value = NULL, $expected_term_reference_tid = NULL) {
+  protected function assertEntity(int $id, string $expected_language, string $expected_label, string $expected_vid, string $expected_description = '', string $expected_format = NULL, int $expected_weight = 0, array $expected_parents = [], int $expected_field_integer_value = NULL, int $expected_term_reference_tid = NULL): void {
     /** @var \Drupal\taxonomy\TermInterface $entity */
     $entity = Term::load($id);
     $this->assertInstanceOf(TermInterface::class, $entity);
@@ -78,7 +80,7 @@ protected function assertEntity($id, $expected_language, $expected_label, $expec
     $this->assertSame($expected_vid, $entity->bundle());
     $this->assertSame($expected_description, $entity->getDescription());
     $this->assertSame($expected_format, $entity->getFormat());
-    $this->assertSame($expected_weight, $entity->getWeight());
+    $this->assertSame($expected_weight, (int) $entity->getWeight());
     $this->assertHierarchy($expected_vid, $id, $expected_parents);
   }
 
@@ -91,8 +93,10 @@ protected function assertEntity($id, $expected_language, $expected_label, $expec
    *   ID of the term to check.
    * @param array $parent_ids
    *   The expected parent term IDs.
+   *
+   * @internal
    */
-  protected function assertHierarchy($vid, $tid, array $parent_ids) {
+  protected function assertHierarchy(string $vid, int $tid, array $parent_ids): void {
     if (!isset($this->treeData[$vid])) {
       $tree = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree($vid);
       $this->treeData[$vid] = [];
@@ -110,9 +114,9 @@ protected function assertHierarchy($vid, $tid, array $parent_ids) {
    * Tests the Drupal 6 i18n localized taxonomy term to Drupal 8 migration.
    */
   public function testTranslatedLocalizedTaxonomyTerms() {
-    $this->assertEntity(19, 'en', 'Jupiter Station', 'vocablocalized', 'Holographic research.', 'filtered_html', '0', []);
-    $this->assertEntity(20, 'en', 'DS9', 'vocablocalized', 'Terok Nor', 'filtered_html', '0', []);
-    $this->assertEntity(25, 'en', 'Emissary', 'vocablocalized2', 'Pilot episode', 'filtered_html', '0', []);
+    $this->assertEntity(19, 'en', 'Jupiter Station', 'vocablocalized', 'Holographic research.', 'filtered_html', 0, []);
+    $this->assertEntity(20, 'en', 'DS9', 'vocablocalized', 'Terok Nor', 'filtered_html', 0, []);
+    $this->assertEntity(25, 'en', 'Emissary', 'vocablocalized2', 'Pilot episode', 'filtered_html', 0, []);
 
     /** @var \Drupal\taxonomy\TermInterface $entity */
     $entity = Term::load(19);
diff --git a/core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php b/core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php
index 444bb85a86ba..02683a629122 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php
@@ -134,8 +134,10 @@ protected function setupQueryTagTestHooks() {
    * @param int $expected_specific_invocations
    *   The number of times the tag-specific query_alter hooks are expected to
    *   have been invoked.
+   *
+   * @internal
    */
-  protected function assertQueryTagTestResult($expected_generic_invocations, $expected_specific_invocations) {
+  protected function assertQueryTagTestResult(int $expected_generic_invocations, int $expected_specific_invocations): void {
     $state = $this->container->get('state');
     $this->assertEquals($expected_generic_invocations, $state->get('taxonomy_test_query_alter'));
     $this->assertEquals($expected_specific_invocations, $state->get('taxonomy_test_query_term_access_alter'));
diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermArgumentDepthTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermArgumentDepthTest.php
index 1a04055ef579..bd03bb13bc26 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermArgumentDepthTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermArgumentDepthTest.php
@@ -178,6 +178,8 @@ public function testTermWithDepthFilter(): void {
    *   The depth to search.
    * @param bool $break_phrase
    *   Whether to break the argument up into multiple terms.
+   *
+   * @internal
    */
   protected function assertTermWithDepthResult(array $expected, $tid, int $depth, bool $break_phrase = FALSE): void {
     $this->view->destroy();
diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermFilterDepthTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermFilterDepthTest.php
index f679633af8be..51c7c5300984 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermFilterDepthTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermFilterDepthTest.php
@@ -155,6 +155,8 @@ public function testTermWithDepthFilter(): void {
    *   The term ID or IDs to filter on.
    * @param int $depth
    *   The depth to search.
+   *
+   * @internal
    */
   protected function assertTermWithDepthResult(array $expected, $tid, int $depth): void {
     $this->view->destroy();
diff --git a/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php b/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php
index 2c51a91ea498..12f8b9dc2135 100644
--- a/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php
+++ b/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php
@@ -40,8 +40,10 @@ protected function setUp(): void {
 
   /**
    * Helper to test toggling the summary area.
+   *
+   * @internal
    */
-  protected function assertSummaryToggle() {
+  protected function assertSummaryToggle(): void {
     $this->drupalGet('node/add/page');
     $widget = $this->getSession()->getPage()->findById('edit-body-wrapper');
     $summary_field = $widget->findField('edit-body-0-summary');
diff --git a/core/modules/text/tests/src/Kernel/TextSummaryTest.php b/core/modules/text/tests/src/Kernel/TextSummaryTest.php
index c1e79d241578..5537e74acc0c 100644
--- a/core/modules/text/tests/src/Kernel/TextSummaryTest.php
+++ b/core/modules/text/tests/src/Kernel/TextSummaryTest.php
@@ -238,8 +238,10 @@ public function testInvalidFilterFormat() {
 
   /**
    * Calls text_summary() and asserts that the expected teaser is returned.
+   *
+   * @internal
    */
-  public function assertTextSummary($text, $expected, $format = NULL, $size = NULL) {
+  public function assertTextSummary(string $text, string $expected, ?string $format = NULL, int $size = NULL): void {
     $summary = text_summary($text, $format, $size);
     $this->assertSame($expected, $summary, new FormattableMarkup('<pre style="white-space: pre-wrap">@actual</pre> is identical to <pre style="white-space: pre-wrap">@expected</pre>', ['@actual' => $summary, '@expected' => $expected]));
   }
diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
index 65975d1e25ba..2b2ef5a3c99c 100644
--- a/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
+++ b/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
@@ -453,8 +453,10 @@ private function getSubtreesHash() {
   /**
    * Asserts the subtrees hash on a fresh page GET is different from the hash
    * from the previous page GET.
+   *
+   * @internal
    */
-  private function assertDifferentHash() {
+  private function assertDifferentHash(): void {
     // Request a new page to refresh the drupalSettings object.
     $this->drupalGet('test-page');
     $this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php
index 5de4c2d8b62d..c7ff8b304f48 100644
--- a/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php
+++ b/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php
@@ -107,8 +107,10 @@ public function testToolbarCacheContextsCaller() {
    *   Expected cache contexts for both users.
    * @param string $message
    *   (optional) A verbose message to output.
+   *
+   * @internal
    */
-  protected function assertToolbarCacheContexts(array $cache_contexts, $message = NULL) {
+  protected function assertToolbarCacheContexts(array $cache_contexts, string $message = NULL): void {
     // Default cache contexts that should exist on all test cases.
     $default_cache_contexts = [
       'languages:language_interface',
diff --git a/core/modules/tour/tests/src/FunctionalJavascript/TourLegacyTest.php b/core/modules/tour/tests/src/FunctionalJavascript/TourLegacyTest.php
index f33a80f5f7d3..eefdc4d52c9d 100644
--- a/core/modules/tour/tests/src/FunctionalJavascript/TourLegacyTest.php
+++ b/core/modules/tour/tests/src/FunctionalJavascript/TourLegacyTest.php
@@ -92,8 +92,10 @@ public function testTourTipMarkup(string $path, string $theme = NULL) {
    *   The expected position of the nub arrow.
    * @param string $joyride_content_container_name
    *   For identifying classnames specific to a tip type.
+   *
+   * @internal
    */
-  private function assertToolTipMarkup($index, $nub_position, $joyride_content_container_name = 'body') {
+  private function assertToolTipMarkup(int $index, string $nub_position, string $joyride_content_container_name = 'body'): void {
     $assert_session = $this->assertSession();
     $tip = $assert_session->waitForElementVisible('css', ".joyride-tip-guide[data-index=\"$index\"]");
     $this->assertNotNull($tip, 'The tour tip element is present.');
diff --git a/core/modules/tracker/tests/src/Functional/TrackerTest.php b/core/modules/tracker/tests/src/Functional/TrackerTest.php
index 4c01a0d06dc1..b3515564535a 100644
--- a/core/modules/tracker/tests/src/Functional/TrackerTest.php
+++ b/core/modules/tracker/tests/src/Functional/TrackerTest.php
@@ -474,8 +474,10 @@ public function testTrackerAdminUnpublish() {
    *   data-history-node-last-comment-timestamp attribute.
    * @param bool $library_is_present
    *   Whether the drupal.tracker-history library should be present or not.
+   *
+   * @internal
    */
-  public function assertHistoryMetadata($node_id, $node_timestamp, $node_last_comment_timestamp, $library_is_present = TRUE) {
+  public function assertHistoryMetadata(int $node_id, int $node_timestamp, int $node_last_comment_timestamp, bool $library_is_present = TRUE): void {
     $settings = $this->getDrupalSettings();
     $this->assertSame($library_is_present, isset($settings['ajaxPageState']) && in_array('tracker/history', explode(',', $settings['ajaxPageState']['libraries'])), 'drupal.tracker-history library is present.');
     $this->assertCount(1, $this->xpath('//table/tbody/tr/td[@data-history-node-id="' . $node_id . '" and @data-history-node-timestamp="' . $node_timestamp . '"]'), 'Tracker table cell contains the data-history-node-id and data-history-node-timestamp attributes for the node.');
diff --git a/core/modules/update/tests/src/Functional/UpdateContribTest.php b/core/modules/update/tests/src/Functional/UpdateContribTest.php
index 3b07f69161d2..30898f0c2d9d 100644
--- a/core/modules/update/tests/src/Functional/UpdateContribTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateContribTest.php
@@ -871,8 +871,10 @@ public function testNonStandardVersionStrings() {
    *   The expected release title.
    * @param bool $is_compatible
    *   If the update is compatible with the installed version of Drupal.
+   *
+   * @internal
    */
-  protected function assertCoreCompatibilityMessage($version, $expected_range, $expected_release_title, $is_compatible = TRUE) {
+  protected function assertCoreCompatibilityMessage(string $version, string $expected_range, string $expected_release_title, bool $is_compatible = TRUE): void {
     $update_element = $this->findUpdateElementByLabel($expected_release_title);
     $this->assertTrue($update_element->hasLink($version));
     $compatibility_details = $update_element->find('css', '.project-update__compatibility-details details');
diff --git a/core/modules/user/tests/src/Functional/RestRegisterUserTest.php b/core/modules/user/tests/src/Functional/RestRegisterUserTest.php
index 7bcdf26583cc..302944f924ed 100644
--- a/core/modules/user/tests/src/Functional/RestRegisterUserTest.php
+++ b/core/modules/user/tests/src/Functional/RestRegisterUserTest.php
@@ -256,7 +256,7 @@ protected function setUpAuthorization($method) {
   /**
    * {@inheritdoc}
    */
-  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options) {}
+  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options): void {}
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/user/tests/src/Functional/UserLoginHttpTest.php b/core/modules/user/tests/src/Functional/UserLoginHttpTest.php
index 87c68c2c718d..7751707a1398 100644
--- a/core/modules/user/tests/src/Functional/UserLoginHttpTest.php
+++ b/core/modules/user/tests/src/Functional/UserLoginHttpTest.php
@@ -325,12 +325,14 @@ public function testGlobalLoginFloodControl() {
    *   The response object.
    * @param int $expected_code
    *   The expected status code.
-   * @param mixed $expected_body
+   * @param string $expected_body
    *   The expected response body.
+   *
+   * @internal
    */
-  protected function assertHttpResponse(ResponseInterface $response, $expected_code, $expected_body) {
+  protected function assertHttpResponse(ResponseInterface $response, int $expected_code, string $expected_body): void {
     $this->assertEquals($expected_code, $response->getStatusCode());
-    $this->assertEquals($expected_body, (string) $response->getBody());
+    $this->assertEquals($expected_body, $response->getBody());
   }
 
   /**
@@ -344,8 +346,10 @@ protected function assertHttpResponse(ResponseInterface $response, $expected_cod
    *   The expected message encoded in response.
    * @param string $format
    *   The format that the response is encoded in.
+   *
+   * @internal
    */
-  protected function assertHttpResponseWithMessage(ResponseInterface $response, $expected_code, $expected_message, $format = 'json') {
+  protected function assertHttpResponseWithMessage(ResponseInterface $response, int $expected_code, string $expected_message, string $format = 'json'): void {
     $this->assertEquals($expected_code, $response->getStatusCode());
     $this->assertEquals($expected_message, $this->getResultValue($response, 'message', $format));
   }
diff --git a/core/modules/user/tests/src/Functional/UserLoginTest.php b/core/modules/user/tests/src/Functional/UserLoginTest.php
index 778f1744853c..cbc3b29cbeb4 100644
--- a/core/modules/user/tests/src/Functional/UserLoginTest.php
+++ b/core/modules/user/tests/src/Functional/UserLoginTest.php
@@ -188,15 +188,16 @@ public function testCookiesNotAccepted() {
    *
    * @param \Drupal\user\Entity\User $account
    *   A user object with name and passRaw attributes for the login attempt.
-   * @param mixed $flood_trigger
+   * @param string $flood_trigger
    *   (optional) Whether or not to expect that the flood control mechanism
    *    will be triggered. Defaults to NULL.
    *   - Set to 'user' to expect a 'too many failed logins error.
-   *   - Set to any value to expect an error for too many failed logins per IP
-   *   .
+   *   - Set to any value to expect an error for too many failed logins per IP.
    *   - Set to NULL to expect a failed login.
+   *
+   * @internal
    */
-  public function assertFailedLogin($account, $flood_trigger = NULL) {
+  public function assertFailedLogin(User $account, string $flood_trigger = NULL): void {
     $database = \Drupal::database();
     $edit = [
       'name' => $account->getAccountName(),
diff --git a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
index 775f2806c1d3..e984c466edd0 100644
--- a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
+++ b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
@@ -486,8 +486,10 @@ public function testUserResetPasswordUserFloodControlIsCleared() {
 
   /**
    * Helper function to make assertions about a valid password reset.
+   *
+   * @internal
    */
-  public function assertValidPasswordReset($name) {
+  public function assertValidPasswordReset(string $name): void {
     $this->assertSession()->pageTextContains("If $name is a valid account, an email will be sent with instructions to reset your password.");
     $this->assertMail('to', $this->account->getEmail(), 'Password e-mail sent to user.');
     $subject = 'Replacement login information for ' . $this->account->getAccountName() . ' at Drupal';
@@ -499,8 +501,10 @@ public function assertValidPasswordReset($name) {
    *
    * @param string $name
    *   The user name.
+   *
+   * @internal
    */
-  public function assertNoValidPasswordReset($name) {
+  public function assertNoValidPasswordReset(string $name): void {
     // This message is the same as the valid reset for privacy reasons.
     $this->assertSession()->pageTextContains("If $name is a valid account, an email will be sent with instructions to reset your password.");
     // The difference is that no email is sent.
@@ -509,15 +513,19 @@ public function assertNoValidPasswordReset($name) {
 
   /**
    * Makes assertions about a password reset triggering IP flood control.
+   *
+   * @internal
    */
-  public function assertPasswordIpFlood() {
+  public function assertPasswordIpFlood(): void {
     $this->assertSession()->pageTextContains('Too many password recovery requests from your IP address. It is temporarily blocked. Try again later or contact the site administrator.');
   }
 
   /**
    * Makes assertions about a password reset not triggering IP flood control.
+   *
+   * @internal
    */
-  public function assertNoPasswordIpFlood() {
+  public function assertNoPasswordIpFlood(): void {
     $this->assertSession()->pageTextNotContains('Too many password recovery requests from your IP address. It is temporarily blocked. Try again later or contact the site administrator.');
   }
 
diff --git a/core/modules/user/tests/src/Functional/UserRegistrationTest.php b/core/modules/user/tests/src/Functional/UserRegistrationTest.php
index 4575ee9ba8e8..bd4d375b8963 100644
--- a/core/modules/user/tests/src/Functional/UserRegistrationTest.php
+++ b/core/modules/user/tests/src/Functional/UserRegistrationTest.php
@@ -397,8 +397,10 @@ public function testRegistrationWithUserFields() {
 
   /**
    * Asserts the presence of cache tags on registration form with user fields.
+   *
+   * @internal
    */
-  protected function assertRegistrationFormCacheTagsWithUserFields() {
+  protected function assertRegistrationFormCacheTagsWithUserFields(): void {
     $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:core.entity_form_display.user.user.register');
     $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:field.field.user.user.test_user_field');
     $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:field.storage.user.test_user_field');
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureD6FileTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureD6FileTest.php
index ffeb2442ba7a..d31525e02088 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureD6FileTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureD6FileTest.php
@@ -51,12 +51,12 @@ public function testUserPictures() {
 
     // Tests the D6 user pictures migration in combination with D6 file.
     $this->setUpMigratedFiles();
-    $this->assertEntity(1, 'image-test.jpg', '1901', 'public://image-test.jpg', 'image/jpeg', '2');
-    $this->assertEntity(2, 'image-test.png', '125', 'public://image-test.png', 'image/png', '8');
-    $this->assertEntity(3, 'Image1.png', '39325', 'public://image-1.png', 'image/png', '1');
-    $this->assertEntity(4, 'Image2.jpg', '1831', 'public://image-2.jpg', 'image/jpeg', '1');
-    $this->assertEntity(5, 'Image-test.gif', '183', 'public://image-test.gif', 'image/jpeg', '1');
-    $this->assertEntity(6, 'html-1.txt', '24', 'public://html-1.txt', 'text/plain', '1');
+    $this->assertEntity(1, 'image-test.jpg', 1901, 'public://image-test.jpg', 'image/jpeg', 2);
+    $this->assertEntity(2, 'image-test.png', 125, 'public://image-test.png', 'image/png', 8);
+    $this->assertEntity(3, 'Image1.png', 39325, 'public://image-1.png', 'image/png', 1);
+    $this->assertEntity(4, 'Image2.jpg', 1831, 'public://image-2.jpg', 'image/jpeg', 1);
+    $this->assertEntity(5, 'Image-test.gif', 183, 'public://image-test.gif', 'image/jpeg', 1);
+    $this->assertEntity(6, 'html-1.txt', 24, 'public://html-1.txt', 'text/plain', 1);
   }
 
   /**
@@ -74,16 +74,18 @@ public function testUserPictures() {
    *   The expected MIME type.
    * @param int $uid
    *   The expected file owner ID.
+   *
+   * @internal
    */
-  protected function assertEntity($fid, $name, $size, $uri, $type, $uid) {
+  protected function assertEntity(int $fid, string $name, int $size, string $uri, string $type, int $uid): void {
     /** @var \Drupal\file\FileInterface $file */
     $file = File::load($fid);
     $this->assertInstanceOf(FileInterface::class, $file);
     $this->assertSame($name, $file->getFilename());
-    $this->assertSame($size, $file->getSize());
+    $this->assertSame($size, (int) $file->getSize());
     $this->assertSame($uri, $file->getFileUri());
     $this->assertSame($type, $file->getMimeType());
-    $this->assertSame($uid, $file->getOwnerId());
+    $this->assertSame($uid, (int) $file->getOwnerId());
   }
 
 }
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserRoleTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserRoleTest.php
index cab4de4a5e5f..ea6f946358ae 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserRoleTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserRoleTest.php
@@ -33,8 +33,10 @@ protected function setUp(): void {
    *   The original numeric ID of the role in the source database.
    * @param \Drupal\migrate\Plugin\MigrateIdMapInterface $id_map
    *   The map table plugin.
+   *
+   * @internal
    */
-  protected function assertRole($id, array $permissions, $lookupId, MigrateIdMapInterface $id_map) {
+  protected function assertRole(string $id, array $permissions, int $lookupId, MigrateIdMapInterface $id_map): void {
     /** @var \Drupal\user\RoleInterface $role */
     $role = Role::load($id);
     $this->assertInstanceOf(RoleInterface::class, $role);
@@ -49,8 +51,10 @@ protected function assertRole($id, array $permissions, $lookupId, MigrateIdMapIn
    *
    * @param \Drupal\migrate\Plugin\MigrateIdMapInterface $id_map
    *   The map table plugin.
+   *
+   * @internal
    */
-  protected function assertRoles(MigrateIdMapInterface $id_map) {
+  protected function assertRoles(MigrateIdMapInterface $id_map): void {
 
     // The permissions for each role are found in the two tables in the Drupal 6
     // source database. One is the permission table and the other is the
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserRoleTest.php b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserRoleTest.php
index 9b3495028efe..4d7fcd66b737 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserRoleTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserRoleTest.php
@@ -29,10 +29,12 @@ protected function setUp(): void {
    *   The role ID.
    * @param string $label
    *   The role's expected label.
-   * @param int|null $original_rid
+   * @param int $original_rid
    *   The original (integer) ID of the role, to check permissions.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $label, $original_rid) {
+  protected function assertEntity(string $id, string $label, int $original_rid): void {
     /** @var \Drupal\user\RoleInterface $entity */
     $entity = Role::load($id);
     $this->assertInstanceOf(RoleInterface::class, $entity);
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserTest.php b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserTest.php
index 655b460f47ae..f8c533bc6efd 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserTest.php
@@ -79,24 +79,26 @@ protected function setUp(): void {
    *   The user's initial email address.
    * @param string[] $roles
    *   Role IDs the user account is expected to have.
-   * @param int $field_integer
+   * @param array|null $field_integer
    *   The value of the integer field.
    * @param int|false $field_file_target_id
    *   (optional) The target ID of the file field.
    * @param bool $has_picture
    *   (optional) Whether the user is expected to have a picture attached.
+   *
+   * @internal
    */
-  protected function assertEntity($id, $label, $mail, $password, $created, $access, $login, $blocked, $entity_langcode, $prefered_langcode, $timezone, $init, $roles, $field_integer, $field_file_target_id = FALSE, $has_picture = FALSE) {
+  protected function assertEntity(string $id, string $label, string $mail, string $password, int $created, int $access, int $login, bool $blocked, string $entity_langcode, string $prefered_langcode, string $timezone, string $init, array $roles, ?array $field_integer, $field_file_target_id = FALSE, bool $has_picture = FALSE): void {
     /** @var \Drupal\user\UserInterface $user */
     $user = User::load($id);
     $this->assertInstanceOf(UserInterface::class, $user);
     $this->assertSame($label, $user->label());
     $this->assertSame($mail, $user->getEmail());
     $this->assertSame($password, $user->getPassword());
-    $this->assertSame($created, $user->getCreatedTime());
-    $this->assertSame($access, $user->getLastAccessedTime());
-    $this->assertSame($login, $user->getLastLoginTime());
-    $this->assertNotSame($blocked, $user->isBlocked());
+    $this->assertSame($created, (int) $user->getCreatedTime());
+    $this->assertSame($access, (int) $user->getLastAccessedTime());
+    $this->assertSame($login, (int) $user->getLastLoginTime());
+    $this->assertNotSame($blocked, (bool) $user->isBlocked());
 
     // Ensure the user's langcode, preferred_langcode and
     // preferred_admin_langcode are valid.
diff --git a/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php b/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
index 00c75cd60457..1aabea79a8a5 100644
--- a/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
+++ b/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
@@ -89,8 +89,10 @@ public function testUserEditForm() {
    *
    * @param array $elements
    *   A form array section that contains the user account form elements.
+   *
+   * @internal
    */
-  protected function assertFieldOrder(array $elements) {
+  protected function assertFieldOrder(array $elements): void {
     $name_index = 0;
     $name_weight = 0;
     $pass_index = 0;
diff --git a/core/modules/user/tests/src/Kernel/UserValidationTest.php b/core/modules/user/tests/src/Kernel/UserValidationTest.php
index 73886da53eae..579b8b4be0de 100644
--- a/core/modules/user/tests/src/Kernel/UserValidationTest.php
+++ b/core/modules/user/tests/src/Kernel/UserValidationTest.php
@@ -198,8 +198,10 @@ public function testValidation() {
    *   (optional) The number of expected violations. Defaults to 1.
    * @param int $expected_index
    *   (optional) The index at which to expect the violation. Defaults to 0.
+   *
+   * @internal
    */
-  protected function assertLengthViolation(EntityInterface $entity, $field_name, $length, $count = 1, $expected_index = 0) {
+  protected function assertLengthViolation(EntityInterface $entity, string $field_name, int $length, int $count = 1, int $expected_index = 0): void {
     $violations = $entity->validate();
     $this->assertCount($count, $violations, "Violation found when $field_name is too long.");
     $this->assertEquals("{$field_name}.0.value", $violations[$expected_index]->getPropertyPath());
@@ -214,8 +216,10 @@ protected function assertLengthViolation(EntityInterface $entity, $field_name, $
    *   The entity object to validate.
    * @param string $field_name
    *   The name of the field to verify.
+   *
+   * @internal
    */
-  protected function assertAllowedValuesViolation(EntityInterface $entity, $field_name) {
+  protected function assertAllowedValuesViolation(EntityInterface $entity, string $field_name): void {
     $violations = $entity->validate();
     $this->assertCount(1, $violations, "Allowed values violation for $field_name found.");
     $this->assertEquals($field_name === 'langcode' ? "{$field_name}.0" : "{$field_name}.0.value", $violations[0]->getPropertyPath());
diff --git a/core/modules/user/tests/src/Unit/PermissionHandlerTest.php b/core/modules/user/tests/src/Unit/PermissionHandlerTest.php
index 36d9254229dc..369b4f299a24 100644
--- a/core/modules/user/tests/src/Unit/PermissionHandlerTest.php
+++ b/core/modules/user/tests/src/Unit/PermissionHandlerTest.php
@@ -332,8 +332,10 @@ public function testPermissionsYamlStaticAndCallback() {
    *
    * @param array $actual_permissions
    *   The actual permissions
+   *
+   * @internal
    */
-  protected function assertPermissions(array $actual_permissions) {
+  protected function assertPermissions(array $actual_permissions): void {
     $this->assertCount(4, $actual_permissions);
     $this->assertEquals('single_description', $actual_permissions['access_module_a']['title']);
     $this->assertEquals('module_a', $actual_permissions['access_module_a']['provider']);
diff --git a/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php b/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
index 2e29bb43e16a..0767c5ca6a50 100644
--- a/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
+++ b/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
@@ -135,8 +135,10 @@ protected function setUp(): void {
 
   /**
    * Asserts correct field access grants for a field.
+   *
+   * @internal
    */
-  public function assertFieldAccess($field, $viewer, $target, $view, $edit) {
+  public function assertFieldAccess(string $field, string $viewer, string $target, bool $view, bool $edit): void {
     $field_definition = $this->createMock('Drupal\Core\Field\FieldDefinitionInterface');
     $field_definition->expects($this->any())
       ->method('getName')
diff --git a/core/modules/views/tests/src/Functional/Entity/FieldEntityTranslationTest.php b/core/modules/views/tests/src/Functional/Entity/FieldEntityTranslationTest.php
index 5a3ed15f306e..c6ef36937125 100644
--- a/core/modules/views/tests/src/Functional/Entity/FieldEntityTranslationTest.php
+++ b/core/modules/views/tests/src/Functional/Entity/FieldEntityTranslationTest.php
@@ -168,8 +168,10 @@ public function testTranslationRows() {
    *
    * @param array $expected
    *   The expected rows of the result.
+   *
+   * @internal
    */
-  protected function assertRows($expected = []) {
+  protected function assertRows(array $expected = []): void {
     $actual = [];
     $rows = $this->cssSelect('div.views-row');
     foreach ($rows as $row) {
diff --git a/core/modules/views/tests/src/Functional/Entity/FieldRenderedEntityTranslationTest.php b/core/modules/views/tests/src/Functional/Entity/FieldRenderedEntityTranslationTest.php
index f61145fe9cc7..f6e063f450da 100644
--- a/core/modules/views/tests/src/Functional/Entity/FieldRenderedEntityTranslationTest.php
+++ b/core/modules/views/tests/src/Functional/Entity/FieldRenderedEntityTranslationTest.php
@@ -287,8 +287,10 @@ public function testTranslationRows() {
    *
    * @param array $expected
    *   The expected rows of the result.
+   *
+   * @internal
    */
-  protected function assertRows(array $expected = []) {
+  protected function assertRows(array $expected = []): void {
     $actual = [];
     $rows = $this->cssSelect('div.views-row');
     foreach ($rows as $row) {
diff --git a/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php b/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
index 520db9cadcf9..3baa6f3943f0 100644
--- a/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
@@ -141,10 +141,10 @@ protected function clickSortLoadIdsFromOutput() {
    *   The value to search for.
    * @param string $message
    *   The message to display along with the assertion.
-   * @param string $group
-   *   The type of assertion - examples are "Browser", "PHP".
+   *
+   * @internal
    */
-  protected function assertSubString($haystack, $needle, $message = '', $group = 'Other') {
+  protected function assertSubString(string $haystack, string $needle, string $message = ''): void {
     $this->assertStringContainsString($needle, $haystack, $message);
   }
 
@@ -157,10 +157,10 @@ protected function assertSubString($haystack, $needle, $message = '', $group = '
    *   The value to search for.
    * @param string $message
    *   The message to display along with the assertion.
-   * @param string $group
-   *   The type of assertion - examples are "Browser", "PHP".
+   *
+   * @internal
    */
-  protected function assertNotSubString($haystack, $needle, $message = '', $group = 'Other') {
+  protected function assertNotSubString(string $haystack, string $needle, string $message = ''): void {
     $this->assertStringNotContainsString($needle, $haystack, $message);
   }
 
diff --git a/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php b/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php
index 38f371799b45..6fc75547dee1 100644
--- a/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php
@@ -152,8 +152,10 @@ public function testPagePaths() {
    *
    * @param string $path
    *   Path that will be set as the view page display path.
+   *
+   * @internal
    */
-  public function assertPagePath($path) {
+  public function assertPagePath(string $path): void {
     $view = Views::getView('test_page_display_path');
     $view->initDisplay('page_1');
     $view->displayHandlers->get('page_1')->overrideOption('path', $path);
diff --git a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
index 92381e1da74c..ea733a5b4a30 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
@@ -414,8 +414,10 @@ public function testExposedSortAndItemsPerPage() {
    *
    * @param int[] $ids
    *   The ids to check.
+   *
+   * @internal
    */
-  protected function assertIds(array $ids) {
+  protected function assertIds(array $ids): void {
     $elements = $this->cssSelect('div.view-test-exposed-form-sort-items-per-page div.views-row span.field-content');
     $actual_ids = [];
     foreach ($elements as $element) {
@@ -492,8 +494,10 @@ public function testExposedFilterPagination() {
    *
    * @param array $bundles
    *   Bundles of nodes.
+   *
+   * @internal
    */
-  protected function assertNodesExist(array $bundles) {
+  protected function assertNodesExist(array $bundles): void {
     foreach ($this->nodes as $node) {
       if (in_array($node->bundle(), $bundles)) {
         $this->assertSession()->pageTextContains($node->label());
diff --git a/core/modules/views/tests/src/Functional/SearchIntegrationTest.php b/core/modules/views/tests/src/Functional/SearchIntegrationTest.php
index 70dc2b6bb880..569c9ef11b23 100644
--- a/core/modules/views/tests/src/Functional/SearchIntegrationTest.php
+++ b/core/modules/views/tests/src/Functional/SearchIntegrationTest.php
@@ -144,15 +144,13 @@ public function testSearchIntegration() {
    * @param string $label
    *   Link label to assert.
    *
-   * @return bool
-   *   TRUE if the assertion succeeded.
+   * @internal
    */
-  protected function assertOneLink($label) {
+  protected function assertOneLink(string $label): void {
     $xpath = $this->assertSession()->buildXPathQuery('//a[normalize-space(text())=:label]', [
       ':label' => $label,
     ]);
     $this->assertSession()->elementsCount('xpath', $xpath, 1);
-    return TRUE;
   }
 
 }
diff --git a/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php
index ff7f60357ac0..f96b468e3ca1 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php
@@ -136,8 +136,10 @@ public function testBasicPagination() {
 
   /**
    * Assert that assets are not loaded twice on a page.
+   *
+   * @internal
    */
-  protected function assertNoDuplicateAssetsOnPage() {
+  protected function assertNoDuplicateAssetsOnPage(): void {
     /** @var \Behat\Mink\Element\NodeElement[] $scripts */
     $scripts = $this->getSession()->getPage()->findAll('xpath', '//script');
     $script_src = [];
diff --git a/core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php b/core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php
index 338223709ab0..fa47eca31b88 100644
--- a/core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php
+++ b/core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php
@@ -95,8 +95,10 @@ public function testCacheableMetadataCalculation() {
    * @param bool $expected_result
    *   TRUE if it is expected that the cacheability metadata has been
    *   calculated. FALSE otherwise.
+   *
+   * @internal
    */
-  protected function assertCacheableMetadataHasBeenCalculated($expected_result) {
+  protected function assertCacheableMetadataHasBeenCalculated(bool $expected_result): void {
     $this->state->resetCache();
     $this->assertEquals($expected_result, $this->state->get('views_test_cacheable_metadata_has_been_accessed'));
   }
diff --git a/core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php b/core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php
index 6bab4cfdbdec..372a4c4add80 100644
--- a/core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php
+++ b/core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php
@@ -637,18 +637,22 @@ public function testRevisionTableFields() {
    *   The views data to check.
    * @param string $field_name
    *   The entity field name.
+   *
+   * @internal
    */
-  protected function assertViewsDataField($data, $field_name) {
+  protected function assertViewsDataField(array $data, string $field_name): void {
     $this->assertEquals($field_name, $data['entity field']);
   }
 
   /**
    * Tests views data for a string field.
    *
-   * @param $data
+   * @param array $data
    *   The views data to check.
+   *
+   * @internal
    */
-  protected function assertStringField($data) {
+  protected function assertStringField(array $data): void {
     $this->assertEquals('field', $data['field']['id']);
     $this->assertEquals('string', $data['filter']['id']);
     $this->assertEquals('string', $data['argument']['id']);
@@ -658,10 +662,12 @@ protected function assertStringField($data) {
   /**
    * Tests views data for a URI field.
    *
-   * @param $data
+   * @param array $data
    *   The views data to check.
+   *
+   * @internal
    */
-  protected function assertUriField($data) {
+  protected function assertUriField(array $data): void {
     $this->assertEquals('field', $data['field']['id']);
     $this->assertEquals('string', $data['field']['default_formatter']);
     $this->assertEquals('string', $data['filter']['id']);
@@ -672,12 +678,14 @@ protected function assertUriField($data) {
   /**
    * Tests views data for a long text field.
    *
-   * @param $data
+   * @param array $data
    *   The views data for the table this field is in.
-   * @param $field_name
+   * @param string $field_name
    *   The name of the field being checked.
+   *
+   * @internal
    */
-  protected function assertLongTextField($data, $field_name) {
+  protected function assertLongTextField(array $data, string $field_name): void {
     $value_field = $data[$field_name . '__value'];
     $this->assertEquals('field', $value_field['field']['id']);
     $this->assertEquals($field_name . '__format', $value_field['field']['format']);
@@ -693,8 +701,10 @@ protected function assertLongTextField($data, $field_name) {
    *
    * @param array $data
    *   The views data to check.
+   *
+   * @internal
    */
-  protected function assertUuidField($data) {
+  protected function assertUuidField(array $data): void {
     // @todo Can we provide additional support for UUIDs in views?
     $this->assertEquals('field', $data['field']['id']);
     $this->assertFalse($data['field']['click sortable']);
@@ -708,8 +718,10 @@ protected function assertUuidField($data) {
    *
    * @param array $data
    *   The views data to check.
+   *
+   * @internal
    */
-  protected function assertNumericField($data) {
+  protected function assertNumericField(array $data): void {
     $this->assertEquals('field', $data['field']['id']);
     $this->assertEquals('numeric', $data['filter']['id']);
     $this->assertEquals('numeric', $data['argument']['id']);
@@ -721,8 +733,10 @@ protected function assertNumericField($data) {
    *
    * @param array $data
    *   The views data to check.
+   *
+   * @internal
    */
-  protected function assertLanguageField($data) {
+  protected function assertLanguageField(array $data): void {
     $this->assertEquals('field', $data['field']['id']);
     $this->assertEquals('language', $data['filter']['id']);
     $this->assertEquals('language', $data['argument']['id']);
@@ -731,8 +745,10 @@ protected function assertLanguageField($data) {
 
   /**
    * Tests views data for an entity reference field.
+   *
+   * @internal
    */
-  protected function assertEntityReferenceField($data) {
+  protected function assertEntityReferenceField(array $data): void {
     $this->assertEquals('field', $data['field']['id']);
     $this->assertEquals('numeric', $data['filter']['id']);
     $this->assertEquals('numeric', $data['argument']['id']);
@@ -741,8 +757,10 @@ protected function assertEntityReferenceField($data) {
 
   /**
    * Tests views data for a bundle field.
+   *
+   * @internal
    */
-  protected function assertBundleField($data) {
+  protected function assertBundleField(array $data): void {
     $this->assertEquals('field', $data['field']['id']);
     $this->assertEquals('bundle', $data['filter']['id']);
     $this->assertEquals('string', $data['argument']['id']);
diff --git a/core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php b/core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php
index 1b47f80b4e47..41606428b747 100644
--- a/core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php
+++ b/core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php
@@ -126,8 +126,10 @@ public function testLatestRevisionFilter() {
    *   An executed View.
    * @param array $not_expected_revision_ids
    *   An array of revision IDs which should not be part of the result set.
+   *
+   * @internal
    */
-  protected function assertNotInResultSet(ViewExecutable $view, array $not_expected_revision_ids) {
+  protected function assertNotInResultSet(ViewExecutable $view, array $not_expected_revision_ids): void {
     $found_revision_ids = array_filter($view->result, function ($row) use ($not_expected_revision_ids) {
       return in_array($row->vid, $not_expected_revision_ids);
     });
diff --git a/core/modules/views/tests/src/Kernel/Entity/RowEntityRenderersTest.php b/core/modules/views/tests/src/Kernel/Entity/RowEntityRenderersTest.php
index d373072d09ed..42eaa3b12d77 100644
--- a/core/modules/views/tests/src/Kernel/Entity/RowEntityRenderersTest.php
+++ b/core/modules/views/tests/src/Kernel/Entity/RowEntityRenderersTest.php
@@ -241,10 +241,10 @@ protected function checkLanguageRenderers($display, $values) {
    *   An array of expected title translation values, one for each result row.
    * @param string $message
    *   (optional) A message to display with the assertion.
-   * @param string $group
-   *   (optional) The group this message is in.
+   *
+   * @internal
    */
-  protected function assertTranslations($display, $renderer_id, array $expected, $message = '', $group = 'Other') {
+  protected function assertTranslations(string $display, string $renderer_id, array $expected, string $message = ''): void {
     $view = Views::getView('test_entity_row_renderers');
     $view->storage->invalidateCaches();
     $view->setDisplay($display);
@@ -267,7 +267,7 @@ protected function assertTranslations($display, $renderer_id, array $expected, $
       }
     }
 
-    $this->assertTrue($result, $message, $group);
+    $this->assertTrue($result, $message);
   }
 
 }
diff --git a/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php b/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
index 9c25d3aead6d..b22c6b1c3b3e 100644
--- a/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
+++ b/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
@@ -548,8 +548,10 @@ protected function getUpdatedViewAndDisplay($revision = FALSE) {
    *
    * @param string[] $updated_view_ids
    *   An array of view IDs.
+   *
+   * @internal
    */
-  protected function assertUpdatedViews($updated_view_ids) {
+  protected function assertUpdatedViews(array $updated_view_ids): void {
     $all_view_ids = array_keys($this->entityTypeManager->getStorage('view')->loadMultiple());
 
     $view_save_count = \Drupal::state()->get('views_test_data.view_save_count', []);
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php
index 82caa80f19bf..659e1490efb7 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php
@@ -302,8 +302,10 @@ public function testAreaDisplayLink() {
    *   The view to check.
    * @param string $display_link_id
    *   The display link ID to check the options for.
+   *
+   * @internal
    */
-  protected function assertFormOptions(ViewExecutable $view, $display_link_id) {
+  protected function assertFormOptions(ViewExecutable $view, string $display_link_id): void {
     $form = [];
     $form_state = new FormState();
     $view->display_handler->getHandler('header', $display_link_id)->buildOptionsForm($form, $form_state);
@@ -319,8 +321,10 @@ protected function assertFormOptions(ViewExecutable $view, $display_link_id) {
    *   The view to check.
    * @param string $display_id
    *   The display ID to check the links for.
+   *
+   * @internal
    */
-  protected function assertRenderedDisplayLinks(ViewExecutable $view, $display_id) {
+  protected function assertRenderedDisplayLinks(ViewExecutable $view, string $display_id): void {
     $page_1_active = $display_id === 'page_1' ? ' is-active' : '';
     $page_2_active = $display_id === 'page_2' ? ' is-active' : '';
 
@@ -368,8 +372,10 @@ protected function renderDisplayLink(ViewExecutable $view, $display_link_id) {
    *
    * @param \Drupal\views\ViewExecutable $view
    *   The view to check.
+   *
+   * @internal
    */
-  protected function assertNoWarningMessages(ViewExecutable $view) {
+  protected function assertNoWarningMessages(ViewExecutable $view): void {
     $messenger = $this->container->get('messenger');
 
     $view->validate();
@@ -385,8 +391,10 @@ protected function assertNoWarningMessages(ViewExecutable $view) {
    *   An array of options that should be unequal.
    *
    * @throws \Exception
+   *
+   * @internal
    */
-  protected function assertWarningMessages(ViewExecutable $view, array $unequal_options) {
+  protected function assertWarningMessages(ViewExecutable $view, array $unequal_options): void {
     $messenger = $this->container->get('messenger');
 
     // Create a list of options to check.
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php
index 5ce5e83c8325..cd584e685983 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\views\Kernel\Handler;
 
 use Drupal\Tests\views\Kernel\ViewsKernelTestBase;
+use Drupal\views\ViewExecutable;
 use Drupal\views\Views;
 
 /**
@@ -142,14 +143,16 @@ public function testFieldDate() {
   /**
    * Asserts properly formatted display against 'created' field in view.
    *
-   * @param mixed $view
+   * @param \Drupal\views\ViewExecutable $view
    *   View to be tested.
    * @param array $map
    *   Data map.
-   * @param null $timezone
+   * @param string|null $timezone
    *   Optional timezone.
+   *
+   * @internal
    */
-  protected function assertRenderedDatesEqual($view, $map, $timezone = NULL) {
+  protected function assertRenderedDatesEqual(ViewExecutable $view, array $map, ?string $timezone = NULL): void {
     foreach ($map as $date_format => $expected_result) {
       $view->field['created']->options['date_format'] = $date_format;
       if (isset($timezone)) {
@@ -167,12 +170,14 @@ protected function assertRenderedDatesEqual($view, $map, $timezone = NULL) {
   /**
    * Asserts properly formatted display against 'destroyed' field in view.
    *
-   * @param mixed $view
+   * @param \Drupal\views\ViewExecutable $view
    *   View to be tested.
    * @param array $map
    *   Data map.
+   *
+   * @internal
    */
-  protected function assertRenderedFutureDatesEqual($view, $map) {
+  protected function assertRenderedFutureDatesEqual(ViewExecutable $view, array $map): void {
     foreach ($map as $format => $result) {
       $view->field['destroyed']->options['date_format'] = $format;
       $view_result = $view->field['destroyed']->advancedRender($view->result[0]);
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php
index 4f910234e9ae..fa37204e0a00 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php
@@ -104,13 +104,10 @@ public function testQuery() {
    *   messages: use \Drupal\Component\Render\FormattableMarkup to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param string $group
-   *   (optional) The group this message is in, which is displayed in a column
-   *   in test output. Use 'Debug' to indicate this is debugging output. Do not
-   *   translate this string. Defaults to 'Other'; most tests do not override
-   *   this default.
+   *
+   * @internal
    */
-  protected function assertSubString($haystack, $needle, $message = '', $group = 'Other') {
+  protected function assertSubString(string $haystack, string $needle, string $message = ''): void {
     $this->assertStringContainsString($needle, $haystack, $message);
   }
 
@@ -126,13 +123,10 @@ protected function assertSubString($haystack, $needle, $message = '', $group = '
    *   messages: use \Drupal\Component\Render\FormattableMarkup to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param string $group
-   *   (optional) The group this message is in, which is displayed in a column
-   *   in test output. Use 'Debug' to indicate this is debugging output. Do not
-   *   translate this string. Defaults to 'Other'; most tests do not override
-   *   this default.
+   *
+   * @internal
    */
-  protected function assertNotSubString($haystack, $needle, $message = '', $group = 'Other') {
+  protected function assertNotSubString(string $haystack, string $needle, string $message = ''): void {
     $this->assertStringNotContainsString($needle, $haystack, $message);
   }
 
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php
index 241c65cec516..1c598edcb29e 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php
@@ -142,8 +142,10 @@ public function testRenderedEntityWithoutField() {
    *
    * @param array $build
    *   The render array
+   *
+   * @internal
    */
-  protected function assertCacheabilityMetadata($build) {
+  protected function assertCacheabilityMetadata(array $build): void {
     $this->assertEqualsCanonicalizing([
       'config:core.entity_view_display.entity_test.entity_test.foobar',
       'config:views.view.test_field_entity_test_rendered',
@@ -168,8 +170,10 @@ protected function assertCacheabilityMetadata($build) {
    *
    * @param \Drupal\views\Entity\View $storage
    *   The view storage.
+   *
+   * @internal
    */
-  protected function assertConfigDependencies(View $storage) {
+  protected function assertConfigDependencies(View $storage): void {
     $storage->calculateDependencies();
     $this->assertEquals([
       'config' => ['core.entity_view_mode.entity_test.foobar'],
diff --git a/core/modules/views/tests/src/Kernel/ModuleTest.php b/core/modules/views/tests/src/Kernel/ModuleTest.php
index f59370d62d0f..8113f573d061 100644
--- a/core/modules/views/tests/src/Kernel/ModuleTest.php
+++ b/core/modules/views/tests/src/Kernel/ModuleTest.php
@@ -8,6 +8,7 @@
 use Drupal\views\Plugin\views\field\Broken as BrokenField;
 use Drupal\views\Plugin\views\filter\Broken as BrokenFilter;
 use Drupal\views\Plugin\views\filter\Standard;
+use Drupal\views\Plugin\views\ViewsHandlerInterface;
 use Drupal\views\Views;
 
 /**
@@ -334,8 +335,10 @@ protected function formatViewOptions(array $views = []) {
 
   /**
    * Ensure that a certain handler is an instance of a certain table/field.
+   *
+   * @internal
    */
-  public function assertInstanceHandler($handler, $table, $field, $id) {
+  public function assertInstanceHandler(ViewsHandlerInterface $handler, string $table, string $field, string $id): void {
     $table_data = $this->container->get('views.views_data')->get($table);
     $field_data = $table_data[$field][$id];
 
diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php b/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php
index 521ab74ed43e..69f940ed05ed 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php
@@ -50,8 +50,10 @@ public function testGrid() {
    *   The alignment of the grid to test.
    * @param int $columns
    *   The number of columns in the grid to test.
+   *
+   * @internal
    */
-  protected function assertGrid(ViewExecutable $view, $alignment, $columns) {
+  protected function assertGrid(ViewExecutable $view, string $alignment, int $columns): void {
     $view->setDisplay('default');
     $view->initStyle();
     $view->initHandlers();
diff --git a/core/modules/views/tests/src/Kernel/PluginInstanceTest.php b/core/modules/views/tests/src/Kernel/PluginInstanceTest.php
index 5858ae115f25..315fae720372 100644
--- a/core/modules/views/tests/src/Kernel/PluginInstanceTest.php
+++ b/core/modules/views/tests/src/Kernel/PluginInstanceTest.php
@@ -93,8 +93,10 @@ public function testPluginInstances() {
    *
    * @param bool $test_deprecated
    *   Indicates if deprecated plugins should be tested or skipped.
+   *
+   * @internal
    */
-  protected function assertPluginInstances($test_deprecated) {
+  protected function assertPluginInstances(bool $test_deprecated): void {
     foreach ($this->definitions as $type => $plugins) {
       // Get a plugin manager for this type.
       $manager = $this->container->get("plugin.manager.views.$type");
diff --git a/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php b/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
index ed1fa20e285b..2ed8125a3b3f 100644
--- a/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
+++ b/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
@@ -87,8 +87,10 @@ public function testFieldBasedViewCacheTagsWithCachePluginTime() {
    *
    * @param bool $do_assert_views_caches
    *   Whether to check Views' result & output caches.
+   *
+   * @internal
    */
-  protected function assertCacheTagsForFieldBasedView($do_assert_views_caches) {
+  protected function assertCacheTagsForFieldBasedView(bool $do_assert_views_caches): void {
     $view = Views::getview('entity_test_fields');
 
     // Empty result (no entities yet).
@@ -229,8 +231,10 @@ public function testEntityBasedViewCacheTagsWithCachePluginTime() {
 
   /**
    * Tests cache tags on output & result cache items for an entity-based view.
+   *
+   * @internal
    */
-  protected function assertCacheTagsForEntityBasedView($do_assert_views_caches) {
+  protected function assertCacheTagsForEntityBasedView(bool $do_assert_views_caches): void {
     $view = Views::getview('entity_test_row');
 
     // Empty result (no entities yet).
diff --git a/core/modules/views/tests/src/Kernel/ViewExecutableTest.php b/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
index 92e4b51d2590..5fa97a3928cf 100644
--- a/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
@@ -362,8 +362,10 @@ public function testDestroy() {
    *
    * @param \Drupal\views\ViewExecutable $view
    *   The view executable.
+   *
+   * @internal
    */
-  protected function assertViewDestroy(ViewExecutable $view) {
+  protected function assertViewDestroy(ViewExecutable $view): void {
     $reflection = new \ReflectionClass($view);
     $defaults = $reflection->getDefaultProperties();
     // The storage and user should remain.
diff --git a/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php b/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
index f0e3ba9ce91e..c0dff398575f 100644
--- a/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
+++ b/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
@@ -437,8 +437,10 @@ protected function getCommands(ViewAjaxResponse $response) {
    *   The response object.
    * @param int $position
    *   The position where the view content command is expected.
+   *
+   * @internal
    */
-  protected function assertViewResultCommand(ViewAjaxResponse $response, $position = 0) {
+  protected function assertViewResultCommand(ViewAjaxResponse $response, int $position = 0): void {
     $commands = $this->getCommands($response);
     $this->assertEquals('insert', $commands[$position]['command']);
     $this->assertEquals('View result', $commands[$position]['data']);
diff --git a/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php b/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php
index 5cd30b04aed9..219951d15544 100644
--- a/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php
@@ -294,19 +294,15 @@ public function testGroupedFilterAdminUiErrors() {
    *
    * @param string $message
    *   The assert message.
-   * @param string $group
-   *   The assertion group.
    *
-   * @return bool
-   *   Result of the assertion.
+   * @internal
    */
-  protected function assertNoGroupedFilterErrors($message = '', $group = 'Other') {
+  protected function assertNoGroupedFilterErrors(string $message = ''): void {
     foreach ($this->groupFormUiErrors as $error) {
       if (empty($message)) {
-        return $this->assertSession()->responseNotContains($error);
+        $this->assertSession()->responseNotContains($error);
       }
     }
-    return TRUE;
   }
 
   /**
diff --git a/core/modules/views_ui/tests/src/Functional/HandlerTest.php b/core/modules/views_ui/tests/src/Functional/HandlerTest.php
index e20089a77c43..e5235989fca6 100644
--- a/core/modules/views_ui/tests/src/Functional/HandlerTest.php
+++ b/core/modules/views_ui/tests/src/Functional/HandlerTest.php
@@ -294,8 +294,10 @@ public function testErrorMissingHelp() {
    *   The field name.
    * @param string $entity_type
    *   The entity type to which the field belongs.
+   *
+   * @internal
    */
-  public function assertNoDuplicateField($field_name, $entity_type) {
+  public function assertNoDuplicateField(string $field_name, string $entity_type): void {
     $elements = $this->xpath('//td[.=:entity_type]/preceding-sibling::td[@class="title" and .=:title]', [':title' => $field_name, ':entity_type' => $entity_type]);
     $this->assertCount(1, $elements, $field_name . ' appears just once in ' . $entity_type . '.');
   }
diff --git a/core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php b/core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php
index bd57872746ca..4aea55c68196 100644
--- a/core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php
+++ b/core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php
@@ -40,12 +40,14 @@ protected function getViewFields($view_name = 'test_view', $display_id = 'defaul
   /**
    * Check if the fields are in the correct order.
    *
-   * @param $view_name
+   * @param string $view_name
    *   The name of the view.
-   * @param $fields
+   * @param array $fields
    *   Array of field names.
+   *
+   * @internal
    */
-  protected function assertFieldOrder($view_name, $fields) {
+  protected function assertFieldOrder(string $view_name, array $fields): void {
     $this->drupalGet('admin/structure/views/nojs/rearrange/' . $view_name . '/default/field');
 
     foreach ($fields as $idx => $field) {
diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php
index 43eab572b48b..9ca8b80a65e2 100644
--- a/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php
+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php
@@ -282,8 +282,10 @@ protected function clickPreviewLinkAJAX(NodeElement $element, $row_count) {
    *
    * @param int $row_count
    *   The expected number of rows in the preview.
+   *
+   * @internal
    */
-  protected function assertPreviewAJAX($row_count) {
+  protected function assertPreviewAJAX(int $row_count): void {
     $elements = $this->getSession()->getPage()->findAll('css', '.view-content .views-row');
     $this->assertCount($row_count, $elements, 'Expected items found on page.');
   }
@@ -297,8 +299,10 @@ protected function assertPreviewAJAX($row_count) {
    *   The class to assert.
    * @param string $message
    *   (optional) A verbose message to output.
+   *
+   * @internal
    */
-  protected function assertClass(NodeElement $element, $class, $message = NULL) {
+  protected function assertClass(NodeElement $element, string $class, string $message = ''): void {
     if (!isset($message)) {
       $message = "Class .$class found.";
     }
diff --git a/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php b/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php
index e97c77820541..8cd3a7163854 100644
--- a/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php
+++ b/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php
@@ -305,8 +305,10 @@ public function testPathAliasesWithTranslation() {
    *
    * @param string[] $paths
    *   An array of paths to check for.
+   *
+   * @internal
    */
-  protected function assertAccessiblePaths(array $paths) {
+  protected function assertAccessiblePaths(array $paths): void {
     foreach ($paths as $path) {
       $this->drupalGet($path);
       $this->assertSession()->statusCodeEquals(200);
@@ -318,8 +320,10 @@ protected function assertAccessiblePaths(array $paths) {
    *
    * @param string[] $paths
    *   An array of paths to check for.
+   *
+   * @internal
    */
-  protected function assertNotAccessiblePaths(array $paths) {
+  protected function assertNotAccessiblePaths(array $paths): void {
     foreach ($paths as $path) {
       $this->drupalGet($path);
       $this->assertSession()->statusCodeEquals(404);
diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php b/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php
index dd32a2682b48..3c86921cf603 100644
--- a/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php
+++ b/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php
@@ -753,8 +753,10 @@ public function testExecuteInWorkspaceContext() {
    *   An array of expected values, as defined in ::testWorkspaces().
    * @param string $entity_type_id
    *   The ID of the entity type that is being tested.
+   *
+   * @internal
    */
-  protected function assertWorkspaceStatus(array $expected, $entity_type_id) {
+  protected function assertWorkspaceStatus(array $expected, string $entity_type_id): void {
     $expected = $this->flattenExpectedValues($expected, $entity_type_id);
 
     $entity_keys = $this->entityTypeManager->getDefinition($entity_type_id)->getKeys();
@@ -823,8 +825,10 @@ protected function assertWorkspaceStatus(array $expected, $entity_type_id) {
    *   An array of expected values, as defined in ::testWorkspaces().
    * @param string $entity_type_id
    *   The ID of the entity type to check.
+   *
+   * @internal
    */
-  protected function assertEntityLoad(array $expected_values, $entity_type_id) {
+  protected function assertEntityLoad(array $expected_values, string $entity_type_id): void {
     // Filter the expected values so we can check only the default revisions.
     $expected_default_revisions = array_filter($expected_values, function ($expected_value) {
       return $expected_value['default_revision'] === TRUE;
@@ -875,8 +879,10 @@ protected function assertEntityLoad(array $expected_values, $entity_type_id) {
    *   An array of expected values, as defined in ::testWorkspaces().
    * @param string $entity_type_id
    *   The ID of the entity type to check.
+   *
+   * @internal
    */
-  protected function assertEntityRevisionLoad(array $expected_values, $entity_type_id) {
+  protected function assertEntityRevisionLoad(array $expected_values, string $entity_type_id): void {
     $entity_keys = $this->entityTypeManager->getDefinition($entity_type_id)->getKeys();
     $id_key = $entity_keys['id'];
     $revision_key = $entity_keys['revision'];
@@ -901,8 +907,10 @@ protected function assertEntityRevisionLoad(array $expected_values, $entity_type
    *   An array of expected values, as defined in ::testWorkspaces().
    * @param string $entity_type_id
    *   The ID of the entity type to check.
+   *
+   * @internal
    */
-  protected function assertEntityQuery(array $expected_values, $entity_type_id) {
+  protected function assertEntityQuery(array $expected_values, string $entity_type_id): void {
     $storage = $this->entityTypeManager->getStorage($entity_type_id);
     $entity_keys = $this->entityTypeManager->getDefinition($entity_type_id)->getKeys();
     $id_key = $entity_keys['id'];
diff --git a/core/profiles/demo_umami/modules/demo_umami_content/tests/src/Functional/UninstallDefaultContentTest.php b/core/profiles/demo_umami/modules/demo_umami_content/tests/src/Functional/UninstallDefaultContentTest.php
index 205575be3a9c..b7235cf77066 100644
--- a/core/profiles/demo_umami/modules/demo_umami_content/tests/src/Functional/UninstallDefaultContentTest.php
+++ b/core/profiles/demo_umami/modules/demo_umami_content/tests/src/Functional/UninstallDefaultContentTest.php
@@ -85,7 +85,7 @@ public function testReinstall() {
    * @param \Drupal\Core\Entity\EntityStorageInterface $node_storage
    *   Node storage.
    */
-  protected function assertRecipesImported(EntityStorageInterface $node_storage) {
+  protected function assertRecipesImported(EntityStorageInterface $node_storage): void {
     $count = $node_storage->getQuery()
       ->accessCheck(FALSE)
       ->condition('type', 'recipe')
@@ -104,7 +104,7 @@ protected function assertRecipesImported(EntityStorageInterface $node_storage) {
    * @param \Drupal\Core\Entity\EntityStorageInterface $node_storage
    *   Node storage.
    */
-  protected function assertArticlesImported(EntityStorageInterface $node_storage) {
+  protected function assertArticlesImported(EntityStorageInterface $node_storage): void {
     $count = $node_storage->getQuery()
       ->accessCheck(FALSE)
       ->condition('type', 'article')
@@ -123,7 +123,7 @@ protected function assertArticlesImported(EntityStorageInterface $node_storage)
    * @param \Drupal\Core\Entity\EntityStorageInterface $block_storage
    *   Block storage.
    */
-  protected function assertImportedCustomBlock(EntityStorageInterface $block_storage) {
+  protected function assertImportedCustomBlock(EntityStorageInterface $block_storage): void {
     $assert = $this->assertSession();
     foreach ($this->expectedBlocks() as $block_info) {
       $this->drupalGet($block_info['path']);
diff --git a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
index be483fd9c03a..89f6a6a20ead 100644
--- a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
+++ b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
@@ -67,7 +67,7 @@ public function testConfig() {
    * @param \Drupal\Core\Config\StorageInterface $active_config_storage
    *   The active configuration storage.
    */
-  protected function assertDefaultConfig(StorageInterface $default_config_storage, StorageInterface $active_config_storage) {
+  protected function assertDefaultConfig(StorageInterface $default_config_storage, StorageInterface $active_config_storage): void {
     /** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */
     $config_manager = $this->container->get('config.manager');
 
diff --git a/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php b/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php
index 7a9370a90dcc..cec79deacf50 100644
--- a/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php
+++ b/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php
@@ -50,7 +50,7 @@ public function testBigPipe() {
    * @param int $expected_count
    *   The expected number of BigPipe placeholders.
    */
-  protected function assertBigPipePlaceholderReplacementCount($expected_count) {
+  protected function assertBigPipePlaceholderReplacementCount($expected_count): void {
     $web_assert = $this->assertSession();
     $web_assert->waitForElement('css', 'script[data-big-pipe-event="stop"]');
     $page = $this->getSession()->getPage();
diff --git a/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php b/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
index 04c5ff9bc007..a80a9482bb8d 100644
--- a/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
+++ b/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
@@ -259,8 +259,10 @@ public function testTemplateCreateProject($project, $package_dir, $docroot_dir)
    *   The expected version.
    * @param string $dir
    *   The path to the site root.
+   *
+   * @internal
    */
-  protected function assertDrupalVersion($expectedVersion, $dir) {
+  protected function assertDrupalVersion(string $expectedVersion, string $dir): void {
     $drupal_php_path = $dir . '/core/lib/Drupal.php';
     $this->assertFileExists($drupal_php_path);
 
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php
index efeb61676905..87ec2d210874 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php
@@ -162,8 +162,10 @@ public function testInsertAjaxResponse() {
    *   Expected result.
    * @param string $script
    *   Script for additional theming.
+   *
+   * @internal
    */
-  public function assertInsert($render_type, $expected, $script = '') {
+  public function assertInsert(string $render_type, string $expected, string $script = ''): void {
     // Check insert to block element.
     $this->drupalGet('ajax-test/insert-block-wrapper');
     $this->getSession()->executeScript($script);
@@ -192,8 +194,10 @@ public function assertInsert($render_type, $expected, $script = '') {
    *
    * @param string $expected
    *   A needle text.
+   *
+   * @internal
    */
-  protected function assertWaitPageContains($expected) {
+  protected function assertWaitPageContains(string $expected): void {
     $page = $this->getSession()->getPage();
     $this->assertTrue($page->waitFor(10, function () use ($page, $expected) {
       // Clear content from empty styles and "processed" classes after effect.
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php
index 11e318551755..5f4b48bf8bd7 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php
@@ -145,8 +145,10 @@ public function testAjaxCommands() {
    *
    * @param string $text
    *   A needle text.
+   *
+   * @internal
    */
-  protected function assertWaitPageContains($text) {
+  protected function assertWaitPageContains(string $text): void {
     $page = $this->getSession()->getPage();
     $page->waitFor(10, function () use ($page, $text) {
       return stripos($page->getContent(), $text) !== FALSE;
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php
index a0c1d57cbb8b..03c6b3af15b6 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php
@@ -109,8 +109,10 @@ protected function waitForMessageRemoved($message, $selector = '[data-drupal-mes
    *
    * @param string $expected_message
    *   The text expected to be present in #drupal-live-announce.
+   *
+   * @internal
    */
-  protected function assertAnnounceContains($expected_message) {
+  protected function assertAnnounceContains(string $expected_message): void {
     $assert_session = $this->assertSession();
     $this->assertNotEmpty($assert_session->waitForElement('css', "#drupal-live-announce:contains('$expected_message')"));
   }
@@ -120,8 +122,10 @@ protected function assertAnnounceContains($expected_message) {
    *
    * @param string $expected_message
    *   The text expected to be absent from #drupal-live-announce.
+   *
+   * @internal
    */
-  protected function assertAnnounceNotContains($expected_message) {
+  protected function assertAnnounceNotContains(string $expected_message): void {
     $assert_session = $this->assertSession();
     $this->assertEmpty($assert_session->waitForElement('css', "#drupal-live-announce:contains('$expected_message')", 1000));
   }
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php
index e52149b74f9a..951330cbd48f 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php
@@ -108,8 +108,10 @@ public function testAddRemoveMessages() {
    *   Expected messages.
    * @param string $messagesSelector
    *   The css selector for the containing messages element.
+   *
+   * @internal
    */
-  protected function assertCurrentMessages(array $expected_messages, $messagesSelector) {
+  protected function assertCurrentMessages(array $expected_messages, string $messagesSelector): void {
     $expected_messages = array_values($expected_messages);
     $current_messages = [];
     if ($message_divs = $this->getSession()->getPage()->findAll('css', "$messagesSelector .messages")) {
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php b/core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
index cf36dc19299f..4003ecf9e69e 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
@@ -156,8 +156,10 @@ public function testKeyboardAccessibility() {
    * @param array|null $structure
    *   The expected table structure. If this isn't specified or equals NULL,
    *   then the expected structure will be set by this method. Defaults to NULL.
+   *
+   * @internal
    */
-  protected function assertKeyboardAccessibility($drupal_path = 'tabledrag_test', $structure = NULL) {
+  protected function assertKeyboardAccessibility(string $drupal_path = 'tabledrag_test', ?array $structure = NULL): void {
     $expected_table = $structure ?: [
       ['id' => 1, 'weight' => 0, 'parent' => '', 'indentation' => 0, 'changed' => FALSE],
       ['id' => 2, 'weight' => 0, 'parent' => '', 'indentation' => 0, 'changed' => FALSE],
@@ -321,8 +323,10 @@ public function testTableDragChangedWarning() {
    *   When any of the given string is not found.
    *
    * @todo Remove this and use the WebAssert method when #2817657 is done.
+   *
+   * @internal
    */
-  protected function assertOrder(array $items) {
+  protected function assertOrder(array $items): void {
     $session = $this->getSession();
     $text = $session->getPage()->getHtml();
     $strings = [];
@@ -484,8 +488,10 @@ public function testNestedDraggableTables() {
    * @param bool $skip_missing
    *   Whether assertions done on missing elements value may be skipped or not.
    *   Defaults to FALSE.
+   *
+   * @internal
    */
-  protected function assertDraggableTable(array $structure, $table_id = 'tabledrag-test-table', $skip_missing = FALSE) {
+  protected function assertDraggableTable(array $structure, string $table_id = 'tabledrag-test-table', bool $skip_missing = FALSE): void {
     $rows = $this->getSession()->getPage()->findAll('xpath', "//table[@id='$table_id']/tbody/tr");
     $this->assertSession()->elementsCount('xpath', "//table[@id='$table_id']/tbody/tr", count($structure));
 
@@ -513,8 +519,10 @@ protected function assertDraggableTable(array $structure, $table_id = 'tabledrag
    * @param bool $skip_missing
    *   Whether assertions done on missing elements value may be skipped or not.
    *   Defaults to FALSE.
+   *
+   * @internal
    */
-  protected function assertTableRow(NodeElement $row, $id, $weight, $parent = '', $indentation = 0, $changed = FALSE, $skip_missing = FALSE) {
+  protected function assertTableRow(NodeElement $row, string $id, int $weight, string $parent = '', int $indentation = 0, ?bool $changed = FALSE, bool $skip_missing = FALSE): void {
     // Assert that the row position is correct by checking that the id
     // corresponds.
     $id_name = "table[$id][id]";
diff --git a/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php b/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
index 21b02065b22b..06dde6ce8d09 100644
--- a/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
+++ b/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
@@ -282,8 +282,10 @@ public function testLoggerException() {
    *
    * @see \Drupal\simpletest\TestBase::prepareEnvironment()
    * @see \Drupal\Core\DrupalKernel::bootConfiguration()
+   *
+   * @internal
    */
-  protected function assertErrorLogged($error_message) {
+  protected function assertErrorLogged(string $error_message): void {
     $error_log_filename = DRUPAL_ROOT . '/' . $this->siteDirectory . '/error.log';
     $this->assertFileExists($error_log_filename);
 
@@ -310,8 +312,10 @@ protected function assertErrorLogged($error_message) {
    *
    * @see \Drupal\simpletest\TestBase::prepareEnvironment()
    * @see \Drupal\Core\DrupalKernel::bootConfiguration()
+   *
+   * @internal
    */
-  protected function assertNoErrorsLogged() {
+  protected function assertNoErrorsLogged(): void {
     // Since PHP only creates the error.log file when an actual error is
     // triggered, it is sufficient to check whether the file exists.
     $this->assertFileDoesNotExist(DRUPAL_ROOT . '/' . $this->siteDirectory . '/error.log');
diff --git a/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php b/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php
index d79ea5b0e0be..0de9040330c0 100644
--- a/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php
+++ b/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php
@@ -71,8 +71,10 @@ public function testThemeConfig($theme) {
    *   Extension name.
    * @param string $type
    *   Extension type, either 'module' or 'theme'.
+   *
+   * @internal
    */
-  protected function assertExtensionConfig(string $name, string $type) {
+  protected function assertExtensionConfig(string $name, string $type): void {
     // System and user are required in order to be able to install some of the
     // other modules. Therefore they are put into static::$modules, which though
     // doesn't install config files, so import those config files explicitly. Do
diff --git a/core/tests/Drupal/KernelTests/Core/Ajax/CommandsTest.php b/core/tests/Drupal/KernelTests/Core/Ajax/CommandsTest.php
index faf8cadb6fc4..487f3c6cd47b 100644
--- a/core/tests/Drupal/KernelTests/Core/Ajax/CommandsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Ajax/CommandsTest.php
@@ -88,14 +88,16 @@ public function testEmptyInsertCommand() {
    * the actual command contains additional settings that aren't part of
    * $needle.
    *
-   * @param $haystack
+   * @param array $haystack
    *   An array of rendered Ajax commands returned by the server.
-   * @param $needle
+   * @param array $needle
    *   Array of info we're expecting in one of those commands.
-   * @param $message
+   * @param string $message
    *   An assertion message.
+   *
+   * @internal
    */
-  protected function assertCommand($haystack, $needle, $message) {
+  protected function assertCommand(array $haystack, array $needle, string $message): void {
     $found = FALSE;
     foreach ($haystack as $command) {
       // If the command has additional settings that we're not testing for, do
diff --git a/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php
index fd58a786a415..82d9d3c670ba 100644
--- a/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php
@@ -262,25 +262,24 @@ protected function activateTheme($theme_name) {
    *   The extension in which the $library is defined.
    * @param string $library_name
    *   Name of the library.
-   * @param mixed $sub_key
+   * @param string $sub_key
    *   The library sub key where the given asset is defined.
    * @param string $message
    *   (optional) A message to display with the assertion.
    *
-   * @return bool
-   *   TRUE if the specified asset is found in the library.
+   * @internal
    */
-  protected function assertAssetInLibrary($asset, $extension, $library_name, $sub_key, $message = NULL) {
+  protected function assertAssetInLibrary(string $asset, string $extension, string $library_name, string $sub_key, string $message = NULL): void {
     if (!isset($message)) {
       $message = sprintf('Asset %s found in library "%s/%s"', $asset, $extension, $library_name);
     }
     $library = $this->libraryDiscovery->getLibraryByName($extension, $library_name);
     foreach ($library[$sub_key] as $definition) {
       if ($asset == $definition['data']) {
-        return TRUE;
+        return;
       }
     }
-    return $this->fail($message);
+    $this->fail($message);
   }
 
   /**
@@ -292,25 +291,23 @@ protected function assertAssetInLibrary($asset, $extension, $library_name, $sub_
    *   The extension in which the $library_name is defined.
    * @param string $library_name
    *   Name of the library.
-   * @param mixed $sub_key
+   * @param string $sub_key
    *   The library sub key where the given asset is defined.
    * @param string $message
    *   (optional) A message to display with the assertion.
    *
-   * @return bool
-   *   TRUE if the specified asset is not found in the library.
+   * @internal
    */
-  protected function assertNoAssetInLibrary($asset, $extension, $library_name, $sub_key, $message = NULL) {
+  protected function assertNoAssetInLibrary(string $asset, string $extension, string $library_name, string $sub_key, string $message = NULL): void {
     if (!isset($message)) {
       $message = sprintf('Asset %s not found in library "%s/%s"', $asset, $extension, $library_name);
     }
     $library = $this->libraryDiscovery->getLibraryByName($extension, $library_name);
     foreach ($library[$sub_key] as $definition) {
       if ($asset == $definition['data']) {
-        return $this->fail($message);
+        $this->fail($message);
       }
     }
-    return TRUE;
   }
 
 }
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php
index 06fda37ec7a9..120cf77de8a6 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php
@@ -151,8 +151,10 @@ public function testCollectionDiff() {
    * @param mixed $closing
    *   (optional) The closing value of the edit. If not supplied, assertion
    *   is skipped.
+   *
+   * @internal
    */
-  protected function assertYamlEdit(array $edits, $field, $type, $orig = NULL, $closing = NULL) {
+  protected function assertYamlEdit(array $edits, string $field, string $type, $orig = NULL, $closing = NULL): void {
     $match = FALSE;
     foreach ($edits as $edit) {
       // Choose which section to search for the field.
diff --git a/core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php b/core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php
index 67a81adbfbea..9b88592c73a1 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php
@@ -95,8 +95,10 @@ protected function getConnectionId() {
    *
    * @param int $id
    *   The connection ID to verify.
+   *
+   * @internal
    */
-  protected function assertConnection($id) {
+  protected function assertConnection(int $id): void {
     $list = $this->monitor->query($this->getQuery()['processlist'])->fetchAllKeyed(0, 0);
     $this->assertTrue(isset($list[$id]), new FormattableMarkup('Connection ID @id found.', ['@id' => $id]));
   }
@@ -106,8 +108,10 @@ protected function assertConnection($id) {
    *
    * @param int $id
    *   The connection ID to verify.
+   *
+   * @internal
    */
-  protected function assertNoConnection($id) {
+  protected function assertNoConnection(int $id): void {
     $list = $this->monitor->query($this->getQuery()['processlist'])->fetchAllKeyed(0, 0);
     $this->assertFalse(isset($list[$id]), new FormattableMarkup('Connection ID @id not found.', ['@id' => $id]));
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php b/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php
index 039e916a33ab..bf73ba4609c8 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php
@@ -672,10 +672,12 @@ public function testSchemaAddFieldDefaultInitial() {
    * The addition test covers both defining a field of a given specification
    * when initially creating at table and extending an existing table.
    *
-   * @param $field_spec
+   * @param array $field_spec
    *   The schema specification of the field.
+   *
+   * @internal
    */
-  protected function assertFieldAdditionRemoval($field_spec) {
+  protected function assertFieldAdditionRemoval(array $field_spec): void {
     // Try creating the field on a new table.
     $table_name = 'test_table_' . ($this->counter++);
     $table_spec = [
@@ -737,8 +739,10 @@ protected function assertFieldAdditionRemoval($field_spec) {
 
   /**
    * Asserts that a newly added field has the correct characteristics.
+   *
+   * @internal
    */
-  protected function assertFieldCharacteristics($table_name, $field_name, $field_spec) {
+  protected function assertFieldCharacteristics(string $table_name, string $field_name, array $field_spec): void {
     // Check that the initial value has been registered.
     if (isset($field_spec['initial'])) {
       // There should be no row with a value different then $field_spec['initial'].
@@ -1007,14 +1011,16 @@ public function testSchemaChangeFieldDefaultInitial() {
   /**
    * Asserts that a field can be changed from one spec to another.
    *
-   * @param $old_spec
+   * @param array $old_spec
    *   The beginning field specification.
-   * @param $new_spec
+   * @param array $new_spec
    *   The ending field specification.
-   * @param $test_data
+   * @param mixed $test_data
    *   (optional) A test value to insert and test, if specified.
+   *
+   * @internal
    */
-  protected function assertFieldChange($old_spec, $new_spec, $test_data = NULL) {
+  protected function assertFieldChange(array $old_spec, array $new_spec, $test_data = NULL): void {
     $table_name = 'test_table_' . ($this->counter++);
     $table_spec = [
       'fields' => [
diff --git a/core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php b/core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php
index d55fe82cbdb1..e76618152a62 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php
@@ -316,12 +316,14 @@ protected function cleanUp() {
   /**
    * Asserts that a given row is present in the test table.
    *
-   * @param $name
+   * @param string $name
    *   The name of the row.
-   * @param $message
+   * @param string $message
    *   The message to log for the assertion.
+   *
+   * @internal
    */
-  public function assertRowPresent($name, $message = NULL) {
+  public function assertRowPresent(string $name, string $message = NULL): void {
     if (!isset($message)) {
       $message = new FormattableMarkup('Row %name is present.', ['%name' => $name]);
     }
@@ -332,12 +334,14 @@ public function assertRowPresent($name, $message = NULL) {
   /**
    * Asserts that a given row is absent from the test table.
    *
-   * @param $name
+   * @param string $name
    *   The name of the row.
-   * @param $message
+   * @param string $message
    *   The message to log for the assertion.
+   *
+   * @internal
    */
-  public function assertRowAbsent($name, $message = NULL) {
+  public function assertRowAbsent(string $name, string $message = NULL): void {
     if (!isset($message)) {
       $message = new FormattableMarkup('Row %name is absent.', ['%name' => $name]);
     }
diff --git a/core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php b/core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php
index 0e790af4c866..161f3b3edef3 100644
--- a/core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php
@@ -252,8 +252,10 @@ public function testDatelistTimezonePropertyProcessed() {
    *   The names of the default input elements used by this element type.
    *
    * @throws \Exception
+   *
+   * @internal
    */
-  protected function assertTimesUnderstoodCorrectly($elementType, array $inputs) {
+  protected function assertTimesUnderstoodCorrectly(string $elementType, array $inputs): void {
     $this->elementType = $elementType;
 
     // Simulate the form being saved, with the user adding the date for any
@@ -326,8 +328,10 @@ protected function assertTimesUnderstoodCorrectly($elementType, array $inputs) {
    *   The element type to test.
    *
    * @throws \Exception
+   *
+   * @internal
    */
-  public function assertDateTimezonePropertyProcessed($elementType) {
+  public function assertDateTimezonePropertyProcessed(string $elementType): void {
     $this->elementType = $elementType;
     // Simulate form being loaded and default values displayed to user.
     $form_state = new FormState();
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php
index 3d755a55c160..bee4cd224e07 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php
@@ -42,8 +42,10 @@ public function testValidation() {
    *
    * @param string|array $bundle
    *   Bundle/bundles to use as constraint option.
+   *
+   * @internal
    */
-  protected function assertValidation($bundle) {
+  protected function assertValidation($bundle): void {
     // Create a typed data definition with a Bundle constraint.
     $definition = DataDefinition::create('entity_reference')
       ->addConstraint('Bundle', $bundle);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php
index 667bae835334..c40a4bebdeb9 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php
@@ -726,8 +726,10 @@ public function testLookupKeys() {
    *
    * @param array $expected
    *   Array of expected entity IDs.
+   *
+   * @internal
    */
-  protected function assertResults($expected) {
+  protected function assertResults(array $expected): void {
     $expected_count = count($expected);
     $this->assertCount($expected_count, $this->queryResults);
     foreach ($expected as $value) {
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityAccessControlHandlerTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityAccessControlHandlerTest.php
index 269dc77eb56d..daa74a9aacca 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityAccessControlHandlerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityAccessControlHandlerTest.php
@@ -38,8 +38,10 @@ public function setUp(): void {
 
   /**
    * Asserts entity access correctly grants or denies access.
+   *
+   * @internal
    */
-  public function assertEntityAccess($ops, AccessibleInterface $object, AccountInterface $account = NULL) {
+  public function assertEntityAccess(array $ops, AccessibleInterface $object, AccountInterface $account = NULL): void {
     foreach ($ops as $op => $result) {
       $message = new FormattableMarkup("Entity access returns @result with operation '@op'.", [
         '@result' => !isset($result) ? 'null' : ($result ? 'true' : 'false'),
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php
index 268cedd70575..ccc1f537affe 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php
@@ -46,8 +46,10 @@ public function testCRUD() {
    *   The entity type to run the tests with.
    * @param \Drupal\user\UserInterface $user1
    *   The user to run the tests with.
+   *
+   * @internal
    */
-  protected function assertCRUD($entity_type, UserInterface $user1) {
+  protected function assertCRUD(string $entity_type, UserInterface $user1): void {
     // Create some test entities.
     $entity = $this->container->get('entity_type.manager')
       ->getStorage($entity_type)
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php
index 6f0ac63ac6b4..a77b0eb5fd92 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php
@@ -68,10 +68,12 @@ protected function setUp(): void {
    * Module entity_crud_hook_test implements all core entity CRUD hooks and
    * stores a message for each in $GLOBALS['entity_crud_hook_test'].
    *
-   * @param $messages
+   * @param array $messages
    *   An array of plain-text messages in the order they should appear.
+   *
+   * @internal
    */
-  protected function assertHookMessageOrder($messages) {
+  protected function assertHookMessageOrder(array $messages): void {
     $positions = [];
     foreach ($messages as $message) {
       // Verify that each message is found and record its position.
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php
index c5e27218c2ab..93d07c4d23ab 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php
@@ -40,8 +40,10 @@ public function testDefaultValues() {
    *
    * @param string $entity_type_id
    *   The entity type to run the tests with.
+   *
+   * @internal
    */
-  protected function assertDefaultValues($entity_type_id) {
+  protected function assertDefaultValues(string $entity_type_id): void {
     $entity = $this->container->get('entity_type.manager')
       ->getStorage($entity_type_id)
       ->create();
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php
index 9a50a78fe6aa..275d9274a6a7 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php
@@ -626,8 +626,10 @@ public function testRepeatedExecution() {
    * @param bool $sorted
    *   (optiOnal) Whether the array keys of the expected are sorted, defaults to
    *   FALSE.
+   *
+   * @internal
    */
-  protected function assertResults($expected, $sorted = FALSE) {
+  protected function assertResults(array $expected, bool $sorted = FALSE): void {
     $found = TRUE;
     $expected_keys = array_keys($expected);
     foreach ($this->queryResult as $key => $row) {
@@ -649,9 +651,11 @@ protected function assertResults($expected, $sorted = FALSE) {
    *
    * @param array $expected
    *   An array of the expected results.
+   *
+   * @internal
    */
-  protected function assertSortedResults($expected) {
-    return $this->assertResults($expected, TRUE);
+  protected function assertSortedResults(array $expected): void {
+    $this->assertResults($expected, TRUE);
   }
 
 }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php
index 54c4484c6ca0..b0983c757764 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php
@@ -224,8 +224,10 @@ public function testInvalidSpecifier() {
    *
    * @param array $expected
    *   A list of indexes in the $this->entities array.
+   *
+   * @internal
    */
-  protected function assertResults($expected) {
+  protected function assertResults(array $expected): void {
     $expected_count = count($expected);
     $this->assertCount($expected_count, $this->queryResults);
     foreach ($expected as $key) {
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
index 176413cf6988..bf35a517f3cb 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
@@ -720,7 +720,10 @@ public function testDelta() {
 
   }
 
-  protected function assertResult() {
+  /**
+   * @internal
+   */
+  protected function assertResult(): void {
     $assert = [];
     $expected = func_get_args();
     if ($expected && is_array($expected[0])) {
@@ -732,16 +735,21 @@ protected function assertResult() {
     $this->assertSame($assert, $this->queryResults);
   }
 
-  protected function assertRevisionResult($keys, $expected) {
+  /**
+   * @internal
+   */
+  protected function assertRevisionResult(array $keys, array $expected): void {
     $assert = [];
     foreach ($expected as $key => $binary) {
       $assert[$keys[$key]] = strval($binary);
     }
     $this->assertSame($assert, $this->queryResults);
-    return $assert;
   }
 
-  protected function assertBundleOrder($order) {
+  /**
+   * @internal
+   */
+  protected function assertBundleOrder(string $order): void {
     // This loop is for bundle1 entities.
     for ($i = 1; $i <= 15; $i += 2) {
       $ok = TRUE;
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php
index 9258c4acf70e..c3005afd879d 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php
@@ -331,10 +331,12 @@ public function testAutocreateApi() {
    *
    * @param \Drupal\Core\Entity\EntityInterface $entity
    *   The referencing entity.
-   * @param $setter_callback
+   * @param callable $setter_callback
    *   A callback setting the target entity on the referencing entity.
+   *
+   * @internal
    */
-  protected function assertUserAutocreate(EntityInterface $entity, $setter_callback) {
+  protected function assertUserAutocreate(EntityInterface $entity, callable $setter_callback): void {
     $storage = $this->entityTypeManager->getStorage('user');
     $user_id = $this->generateRandomEntityId();
     $user = $storage->create(['uid' => $user_id, 'name' => $this->randomString()]);
@@ -350,10 +352,12 @@ protected function assertUserAutocreate(EntityInterface $entity, $setter_callbac
    *
    * @param \Drupal\Core\Entity\EntityInterface $entity
    *   The referencing entity.
-   * @param $setter_callback
+   * @param callable $setter_callback
    *   A callback setting the target entity on the referencing entity.
+   *
+   * @internal
    */
-  protected function assertUserRoleAutocreate(EntityInterface $entity, $setter_callback) {
+  protected function assertUserRoleAutocreate(EntityInterface $entity, callable $setter_callback): void {
     $storage = $this->entityTypeManager->getStorage('user_role');
     $role_id = $this->generateRandomEntityId(TRUE);
     $role = $storage->create(['id' => $role_id, 'label' => $this->randomString()]);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php
index 5bebe5d370c0..bd36cad7b0c3 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php
@@ -300,8 +300,10 @@ protected function doTestLanguageFallback($method_name) {
    *   An entity object or NULL.
    * @param string $expected_entity_type_id
    *   The expected entity type ID.
+   *
+   * @internal
    */
-  protected function assertEntityType($entity, $expected_entity_type_id) {
+  protected function assertEntityType(?object $entity, string $expected_entity_type_id): void {
     $this->assertInstanceOf(EntityTest::class, $entity);
     $this->assertEquals($expected_entity_type_id, $entity->getEntityTypeId());
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php
index f9b7b328aa37..86f116702b39 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php
@@ -35,8 +35,10 @@ public function testCRUD() {
    *
    * @param string $entity_type
    *   The entity type to run the tests with.
+   *
+   * @internal
    */
-  protected function assertCRUD($entity_type) {
+  protected function assertCRUD(string $entity_type): void {
     // Verify that no UUID is auto-generated when passing one for creation.
     $uuid_service = $this->container->get('uuid');
     $uuid = $uuid_service->generate();
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/FieldTranslationSqlStorageTest.php b/core/tests/Drupal/KernelTests/Core/Entity/FieldTranslationSqlStorageTest.php
index 3559c03a8941..0cfff0994fac 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/FieldTranslationSqlStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/FieldTranslationSqlStorageTest.php
@@ -70,8 +70,10 @@ public function testFieldSqlStorage() {
    *   The entity fields are attached to.
    * @param string $message
    *   (optional) A message to display with the assertion.
+   *
+   * @internal
    */
-  protected function assertFieldStorageLangcode(FieldableEntityInterface $entity, $message = '') {
+  protected function assertFieldStorageLangcode(FieldableEntityInterface $entity, string $message = ''): void {
     $status = TRUE;
     $entity_type = $entity->getEntityTypeId();
     $id = $entity->id();
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php b/core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php
index 7cb95a4afd83..ffeea5316653 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php
@@ -381,8 +381,10 @@ protected function insertData($revisionable, $translatable) {
    *   Whether the entity type was revisionable prior to the update.
    * @param bool $translatable
    *   Whether the entity type was translatable prior to the update.
+   *
+   * @internal
    */
-  protected function assertEntityData($revisionable, $translatable) {
+  protected function assertEntityData(bool $revisionable, bool $translatable): void {
     $entities = $this->entityTypeManager->getStorage($this->entityTypeId)->loadMultiple();
     $this->assertCount(3, $entities);
     foreach ($entities as $entity_id => $entity) {
@@ -456,8 +458,10 @@ protected function assertEntityData($revisionable, $translatable) {
    * @param bool $new_base_field
    *   (optional) Whether a new base field was added as part of the update.
    *   Defaults to FALSE.
+   *
+   * @internal
    */
-  protected function assertEntityTypeSchema($revisionable, $translatable, $new_base_field = FALSE) {
+  protected function assertEntityTypeSchema(bool $revisionable, bool $translatable, bool $new_base_field = FALSE): void {
     // Check whether the 'new_base_field' field has been installed correctly.
     $field_storage_definition = $this->entityDefinitionUpdateManager->getFieldStorageDefinition('new_base_field', $this->entityTypeId);
     if ($new_base_field) {
@@ -485,8 +489,10 @@ protected function assertEntityTypeSchema($revisionable, $translatable, $new_bas
 
   /**
    * Asserts the revisionable characteristics of an entity type.
+   *
+   * @internal
    */
-  protected function assertRevisionable() {
+  protected function assertRevisionable(): void {
     /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
     $entity_type = $this->entityDefinitionUpdateManager->getEntityType($this->entityTypeId);
     $this->assertTrue($entity_type->isRevisionable());
@@ -524,8 +530,10 @@ protected function assertRevisionable() {
 
   /**
    * Asserts the translatable characteristics of an entity type.
+   *
+   * @internal
    */
-  protected function assertTranslatable() {
+  protected function assertTranslatable(): void {
     /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
     $entity_type = $this->entityDefinitionUpdateManager->getEntityType($this->entityTypeId);
     $this->assertTrue($entity_type->isTranslatable());
@@ -553,8 +561,10 @@ protected function assertTranslatable() {
 
   /**
    * Asserts the revisionable / translatable characteristics of an entity type.
+   *
+   * @internal
    */
-  protected function assertRevisionableAndTranslatable() {
+  protected function assertRevisionableAndTranslatable(): void {
     $this->assertRevisionable();
     $this->assertTranslatable();
 
@@ -599,8 +609,10 @@ protected function assertRevisionableAndTranslatable() {
 
   /**
    * Asserts that an entity type is neither revisionable nor translatable.
+   *
+   * @internal
    */
-  protected function assertNonRevisionableAndNonTranslatable() {
+  protected function assertNonRevisionableAndNonTranslatable(): void {
     /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
     $entity_type = $this->entityDefinitionUpdateManager->getEntityType($this->entityTypeId);
     $this->assertFalse($entity_type->isRevisionable());
@@ -618,8 +630,10 @@ protected function assertNonRevisionableAndNonTranslatable() {
    *
    * @param bool $revisionable
    *   Whether the entity type is revisionable or not.
+   *
+   * @internal
    */
-  protected function assertBundleFieldSchema($revisionable) {
+  protected function assertBundleFieldSchema(bool $revisionable): void {
     $entity_type_id = 'entity_test_update';
     $field_storage_definition = $this->entityFieldManager->getFieldStorageDefinitions($entity_type_id)['new_bundle_field'];
     $database_schema = $this->database->schema();
@@ -635,8 +649,10 @@ protected function assertBundleFieldSchema($revisionable) {
 
   /**
    * Asserts that the backup tables have been kept after a successful update.
+   *
+   * @internal
    */
-  protected function assertBackupTables() {
+  protected function assertBackupTables(): void {
     $backups = \Drupal::keyValue('entity.update_backup')->getAll();
     $backup = reset($backups);
 
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php b/core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php
index bc38a47d66eb..15d56e68d604 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php
@@ -166,8 +166,10 @@ public function testWasDefaultRevision() {
    *   The number of items expected to be in revisions related tables.
    * @param \Drupal\Core\Entity\EntityTypeInterface $definition
    *   The definition and metadata of the entity being tested.
+   *
+   * @internal
    */
-  protected function assertItemsTableCount($count, EntityTypeInterface $definition) {
+  protected function assertItemsTableCount(int $count, EntityTypeInterface $definition): void {
     $connection = Database::getConnection();
     $this->assertEquals(1, (int) $connection->select($definition->getBaseTable())->countQuery()->execute()->fetchField());
     $this->assertEquals(1, (int) $connection->select($definition->getDataTable())->countQuery()->execute()->fetchField());
diff --git a/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php b/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php
index 15ab322db081..36f1f9cc8397 100644
--- a/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php
@@ -83,10 +83,12 @@ public function testSaveWorkflow() {
    *
    * @param \Drupal\entity_test\Entity\EntityTest $entity
    *   The test entity.
-   * @param $expected_value
+   * @param string $expected_value
    *   The expected field item value.
+   *
+   * @internal
    */
-  protected function assertSavedFieldItemValue(EntityTest $entity, $expected_value) {
+  protected function assertSavedFieldItemValue(EntityTest $entity, string $expected_value): void {
     $entity->setNewRevision(TRUE);
     $entity->save();
     $base_field_expected_value = str_replace($this->fieldName, 'field_test_item', $expected_value);
diff --git a/core/tests/Drupal/KernelTests/Core/File/HtaccessTest.php b/core/tests/Drupal/KernelTests/Core/File/HtaccessTest.php
index b9f59efbd8bc..e49ff3b4c39c 100644
--- a/core/tests/Drupal/KernelTests/Core/File/HtaccessTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/HtaccessTest.php
@@ -97,8 +97,10 @@ public function testHtaccessSave() {
    *   The URI of the file to check.
    * @param int $expected
    *   The expected file permissions; e.g., 0444.
+   *
+   * @internal
    */
-  protected function assertFilePermissions($uri, $expected) {
+  protected function assertFilePermissions(string $uri, int $expected): void {
     $actual = fileperms($uri) & 0777;
     $this->assertSame($actual, $expected, new FormattableMarkup('@uri file permissions @actual are identical to @expected.', [
       '@uri' => $uri,
diff --git a/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php b/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
index ea400d607a61..0704cec75d24 100644
--- a/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
@@ -412,8 +412,10 @@ protected function moveMenuLink($id, $new_parent) {
    *   An ordered array of the IDs of the menu links that are the parents.
    * @param array $children
    *   Array of child IDs that are visible (enabled == 1).
+   *
+   * @internal
    */
-  protected function assertMenuLink($id, array $expected_properties, array $parents = [], array $children = []) {
+  protected function assertMenuLink(string $id, array $expected_properties, array $parents = [], array $children = []): void {
     $query = $this->connection->select('menu_tree');
     $query->fields('menu_tree');
     $query->condition('id', $id);
diff --git a/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php b/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
index b589d0e5f699..73c8c010e7c5 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
@@ -34,8 +34,10 @@ protected function setUp(): void {
    *   The expected markup.
    * @param string $message
    *   Assertion message.
+   *
+   * @internal
    */
-  protected function assertElements(array $elements, $expected_html, $message) {
+  protected function assertElements(array $elements, string $expected_html, string $message): void {
     $actual_html = (string) \Drupal::service('renderer')->renderRoot($elements);
     $this->assertSame($expected_html, $actual_html, Html::escape($message));
   }
diff --git a/core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php b/core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php
index a2c80f893497..95120187bf7d 100644
--- a/core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php
+++ b/core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php
@@ -193,8 +193,10 @@ public function testDateTimestamp($input, array $initial, array $transform) {
    *   @see testTimestamp()
    * @param array $transform
    *   @see testTimestamp()
+   *
+   * @internal
    */
-  public function assertDateTimestamp($date, $input, $initial, $transform) {
+  public function assertDateTimestamp(DateTimePlus $date, string $input, array $initial, array $transform): void {
     // Check format.
     $value = $date->format($initial['format']);
     $this->assertEquals($initial['expected_date'], $value, sprintf("Test new DateTimePlus(%s, %s): should be %s, found %s.", $input, $initial['timezone'], $initial['expected_date'], $value));
diff --git a/core/tests/Drupal/Tests/Component/DrupalComponentTest.php b/core/tests/Drupal/Tests/Component/DrupalComponentTest.php
index 9876f7985d39..74cd216fe55c 100644
--- a/core/tests/Drupal/Tests/Component/DrupalComponentTest.php
+++ b/core/tests/Drupal/Tests/Component/DrupalComponentTest.php
@@ -41,7 +41,7 @@ public function testNoCoreInComponentTests() {
    *
    * @dataProvider \Drupal\Tests\Component\DrupalComponentTest::getComponents
    */
-  public function testComponentLicence($component_path) {
+  public function testComponentLicense($component_path) {
     $this->assertFileExists($component_path . DIRECTORY_SEPARATOR . 'LICENSE.txt');
     $this->assertSame('e84dac1d9fbb5a4a69e38654ce644cea769aa76b', hash_file('sha1', $component_path . DIRECTORY_SEPARATOR . 'LICENSE.txt'));
   }
@@ -90,8 +90,10 @@ protected function findPhpClasses($dir) {
    *
    * @param string $class_path
    *   The full path to the class that should be checked.
+   *
+   * @internal
    */
-  protected function assertNoCoreUsage($class_path) {
+  protected function assertNoCoreUsage(string $class_path): void {
     $contents = file_get_contents($class_path);
     preg_match_all('/^.*Drupal\\\Core.*$/m', $contents, $matches);
     $matches = array_filter($matches[0], function ($line) {
diff --git a/core/tests/Drupal/Tests/Component/Graph/GraphTest.php b/core/tests/Drupal/Tests/Component/Graph/GraphTest.php
index aacd9b59203a..2773d46ba309 100644
--- a/core/tests/Drupal/Tests/Component/Graph/GraphTest.php
+++ b/core/tests/Drupal/Tests/Component/Graph/GraphTest.php
@@ -103,12 +103,14 @@ protected function normalizeGraph($graph) {
   /**
    * Verify expected paths in a graph.
    *
-   * @param $graph
+   * @param array $graph
    *   A graph array processed by \Drupal\Component\Graph\Graph::searchAndSort()
-   * @param $expected_paths
+   * @param array $expected_paths
    *   An associative array containing vertices with their expected paths.
+   *
+   * @internal
    */
-  protected function assertPaths($graph, $expected_paths) {
+  protected function assertPaths(array $graph, array $expected_paths): void {
     foreach ($expected_paths as $vertex => $paths) {
       // Build an array with keys = $paths and values = TRUE.
       $expected = array_fill_keys($paths, TRUE);
@@ -120,13 +122,15 @@ protected function assertPaths($graph, $expected_paths) {
   /**
    * Verify expected reverse paths in a graph.
    *
-   * @param $graph
+   * @param array $graph
    *   A graph array processed by \Drupal\Component\Graph\Graph::searchAndSort()
-   * @param $expected_reverse_paths
+   * @param array $expected_reverse_paths
    *   An associative array containing vertices with their expected reverse
    *   paths.
+   *
+   * @internal
    */
-  protected function assertReversePaths($graph, $expected_reverse_paths) {
+  protected function assertReversePaths(array $graph, array $expected_reverse_paths): void {
     foreach ($expected_reverse_paths as $vertex => $paths) {
       // Build an array with keys = $paths and values = TRUE.
       $expected = array_fill_keys($paths, TRUE);
@@ -138,12 +142,14 @@ protected function assertReversePaths($graph, $expected_reverse_paths) {
   /**
    * Verify expected components in a graph.
    *
-   * @param $graph
+   * @param array $graph
    *   A graph array processed by \Drupal\Component\Graph\Graph::searchAndSort().
-   * @param $expected_components
+   * @param array $expected_components
    *   An array containing of components defined as a list of their vertices.
+   *
+   * @internal
    */
-  protected function assertComponents($graph, $expected_components) {
+  protected function assertComponents(array $graph, array $expected_components): void {
     $unassigned_vertices = array_fill_keys(array_keys($graph), TRUE);
     foreach ($expected_components as $component) {
       $result_components = [];
@@ -159,12 +165,14 @@ protected function assertComponents($graph, $expected_components) {
   /**
    * Verify expected order in a graph.
    *
-   * @param $graph
+   * @param array $graph
    *   A graph array processed by \Drupal\Component\Graph\Graph::searchAndSort()
-   * @param $expected_orders
+   * @param array $expected_orders
    *   An array containing lists of vertices in their expected order.
+   *
+   * @internal
    */
-  protected function assertWeights($graph, $expected_orders) {
+  protected function assertWeights(array $graph, array $expected_orders): void {
     foreach ($expected_orders as $order) {
       $previous_vertex = array_shift($order);
       foreach ($order as $vertex) {
diff --git a/core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php b/core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php
index ce8588a6e728..413991ff5e01 100644
--- a/core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php
@@ -314,8 +314,10 @@ public function providerSortByTitleProperty() {
    *   Expected comparison function return value.
    * @param int $result
    *   Actual comparison function return value.
+   *
+   * @internal
    */
-  protected function assertBothNegativePositiveOrZero($expected, $result) {
+  protected function assertBothNegativePositiveOrZero(int $expected, int $result): void {
     $this->assertIsNumeric($expected);
     $this->assertIsNumeric($result);
     $message = "Numbers should be both negative, both positive or both zero. Expected: $expected, actual: $result";
diff --git a/core/tests/Drupal/Tests/Component/Utility/XssTest.php b/core/tests/Drupal/Tests/Component/Utility/XssTest.php
index b0c434da5d7a..9ecffc195eca 100644
--- a/core/tests/Drupal/Tests/Component/Utility/XssTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/XssTest.php
@@ -594,10 +594,10 @@ public function providerTestFilterXssAdminNotNormalized() {
    *   Lowercase, plain text to look for.
    * @param string $message
    *   (optional) Message to display if failed. Defaults to an empty string.
-   * @param string $group
-   *   (optional) The group this message belongs to. Defaults to 'Other'.
+   *
+   * @internal
    */
-  protected function assertNormalized($haystack, $needle, $message = '', $group = 'Other') {
+  protected function assertNormalized(string $haystack, string $needle, string $message = ''): void {
     $this->assertStringContainsString($needle, strtolower(Html::decodeEntities($haystack)), $message);
   }
 
@@ -616,10 +616,10 @@ protected function assertNormalized($haystack, $needle, $message = '', $group =
    *   Lowercase, plain text to look for.
    * @param string $message
    *   (optional) Message to display if failed. Defaults to an empty string.
-   * @param string $group
-   *   (optional) The group this message belongs to. Defaults to 'Other'.
+   *
+   * @internal
    */
-  protected function assertNotNormalized($haystack, $needle, $message = '', $group = 'Other') {
+  protected function assertNotNormalized(string $haystack, string $needle, string $message = ''): void {
     $this->assertStringNotContainsString($needle, strtolower(Html::decodeEntities($haystack)), $message);
   }
 
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
index 0fd2cfed5b36..12868c0facea 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
@@ -356,8 +356,10 @@ public function testDrupalDrupalFileWasAppended($fixture_name, $is_link, $scaffo
    *   The path to the System-under-Test's docroot.
    * @param bool $is_link
    *   Whether or not symlinking is used.
+   *
+   * @internal
    */
-  protected function assertDefaultSettingsFromScaffoldOverride($docroot, $is_link) {
+  protected function assertDefaultSettingsFromScaffoldOverride(string $docroot, bool $is_link): void {
     $this->assertScaffoldedFile($docroot . '/sites/default/default.settings.php', $is_link, 'scaffolded from the scaffold-override-fixture');
   }
 
@@ -366,8 +368,10 @@ protected function assertDefaultSettingsFromScaffoldOverride($docroot, $is_link)
    *
    * @param string $docroot
    *   The path to the System-under-Test's docroot.
+   *
+   * @internal
    */
-  protected function assertHtaccessExcluded($docroot) {
+  protected function assertHtaccessExcluded(string $docroot): void {
     // Ensure that the .htaccess.txt file was not written, as our
     // top-level composer.json excludes it from the files to scaffold.
     $this->assertFileDoesNotExist($docroot . '/.htaccess');
@@ -384,8 +388,10 @@ protected function assertHtaccessExcluded($docroot) {
    *   The path to the System-under-Test's docroot.
    * @param bool $is_link
    *   Whether or not symlinking is used.
+   *
+   * @internal
    */
-  protected function assertCommonDrupalAssetsWereScaffolded($docroot, $is_link) {
+  protected function assertCommonDrupalAssetsWereScaffolded(string $docroot, bool $is_link): void {
     // Assert scaffold files are written in the correct locations.
     $this->assertScaffoldedFile($docroot . '/.csslintrc', $is_link, 'Test version of .csslintrc from drupal/core.');
     $this->assertScaffoldedFile($docroot . '/.editorconfig', $is_link, 'Test version of .editorconfig from drupal/core.');
@@ -408,8 +414,10 @@ protected function assertCommonDrupalAssetsWereScaffolded($docroot, $is_link) {
    *   Location of the doc root, where autoload.php should be written.
    * @param bool $relocated_docroot
    *   Whether the document root is relocated or now.
+   *
+   * @internal
    */
-  protected function assertAutoloadFileCorrect($docroot, $relocated_docroot = FALSE) {
+  protected function assertAutoloadFileCorrect(string $docroot, bool $relocated_docroot = FALSE): void {
     $autoload_path = $docroot . '/autoload.php';
 
     // Ensure that the autoload.php file was written.
diff --git a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
index 8eef0c87f305..dbe8008b00e9 100644
--- a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
@@ -45,7 +45,10 @@ protected function setUp(): void {
     \Drupal::setContainer($container);
   }
 
-  protected function assertDefaultCacheability(AccessResult $access) {
+  /**
+   * @internal
+   */
+  protected function assertDefaultCacheability(AccessResult $access): void {
     $this->assertSame([], $access->getCacheContexts());
     $this->assertSame([], $access->getCacheTags());
     $this->assertSame(Cache::PERMANENT, $access->getCacheMaxAge());
diff --git a/core/tests/Drupal/Tests/Core/Common/TagsTest.php b/core/tests/Drupal/Tests/Core/Common/TagsTest.php
index 3c3058f9655b..ad2fba9322f3 100644
--- a/core/tests/Drupal/Tests/Core/Common/TagsTest.php
+++ b/core/tests/Drupal/Tests/Core/Common/TagsTest.php
@@ -43,8 +43,10 @@ public function testImplodeTags() {
 
   /**
    * Helper function: asserts that the ending array of tags is what we wanted.
+   *
+   * @internal
    */
-  protected function assertTags($tags) {
+  protected function assertTags(array $tags): void {
     $original = $this->validTags;
     foreach ($tags as $tag) {
       $key = array_search($tag, $original);
diff --git a/core/tests/Drupal/Tests/Core/Config/ConfigTest.php b/core/tests/Drupal/Tests/Core/Config/ConfigTest.php
index 0fba72d8fc1b..d7b6ee5f0e80 100644
--- a/core/tests/Drupal/Tests/Core/Config/ConfigTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/ConfigTest.php
@@ -581,8 +581,10 @@ public function nestedDataProvider() {
    *
    * @param array $data
    *   Config data to be checked.
+   *
+   * @internal
    */
-  public function assertConfigDataEquals($data) {
+  public function assertConfigDataEquals(array $data): void {
     foreach ($data as $key => $value) {
       $this->assertEquals($value, $this->config->get($key));
     }
@@ -595,8 +597,10 @@ public function assertConfigDataEquals($data) {
    *   Config data to be checked.
    * @param bool $apply_overrides
    *   Apply any overrides to the original data.
+   *
+   * @internal
    */
-  public function assertOriginalConfigDataEquals($data, $apply_overrides) {
+  public function assertOriginalConfigDataEquals(array $data, bool $apply_overrides): void {
     foreach ($data as $key => $value) {
       $config_value = $this->config->getOriginal($key, $apply_overrides);
       $this->assertEquals($value, $config_value);
@@ -632,8 +636,10 @@ public function testSafeStringHandling() {
    *   The original data.
    * @param array $overridden_data
    *   The overridden data.
+   *
+   * @internal
    */
-  protected function assertOverriddenKeys(array $data, array $overridden_data) {
+  protected function assertOverriddenKeys(array $data, array $overridden_data): void {
     if (empty($overridden_data)) {
       $this->assertFalse($this->config->hasOverrides());
     }
diff --git a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
index b9b63e0b18fe..bbd4f5ce4aee 100644
--- a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
@@ -180,10 +180,12 @@ public function testGetControllerFromDefinitionNotCallable() {
    * @param string|null $class
    *   Either the name of the class the controller represents, or NULL if it is
    *   not an object.
-   * @param mixed $output
+   * @param string|null $output
    *   The output expected for this controller.
+   *
+   * @internal
    */
-  protected function assertCallableController($controller, $class, $output) {
+  protected function assertCallableController(callable $controller, ?string $class, ?string $output): void {
     if ($class) {
       $this->assertIsObject($controller[0]);
       $this->assertInstanceOf($class, $controller[0]);
diff --git a/core/tests/Drupal/Tests/Core/Entity/Access/EntityFormDisplayAccessControlHandlerTest.php b/core/tests/Drupal/Tests/Core/Entity/Access/EntityFormDisplayAccessControlHandlerTest.php
index b262aa898720..154a1b0c618e 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Access/EntityFormDisplayAccessControlHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Access/EntityFormDisplayAccessControlHandlerTest.php
@@ -202,8 +202,10 @@ protected function setUp(): void {
    *   A list of allowed operations.
    * @param \Drupal\Core\Session\AccountInterface $user
    *   The account to use for get access.
+   *
+   * @internal
    */
-  public function assertAllowOperations(array $allow_operations, AccountInterface $user) {
+  public function assertAllowOperations(array $allow_operations, AccountInterface $user): void {
     foreach (['view', 'update', 'delete'] as $operation) {
       $expected = in_array($operation, $allow_operations);
       $actual = $this->accessControlHandler->access($this->entity, $operation, $user);
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
index a05fe7cac13a..3ffe645995cc 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
@@ -484,8 +484,10 @@ public function testConstraintMethods() {
    *
    * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
    *   The entity type.
+   *
+   * @internal
    */
-  protected function assertNoPublicProperties(EntityTypeInterface $entity_type) {
+  protected function assertNoPublicProperties(EntityTypeInterface $entity_type): void {
     $reflection = new \ReflectionObject($entity_type);
     $this->assertEmpty($reflection->getProperties(\ReflectionProperty::IS_PUBLIC));
   }
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
index 0084e4ecba1a..865779dc090c 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
@@ -460,8 +460,10 @@ protected function getEntity($class, array $values, array $methods = []) {
    *   Whether or not the URL is expected to have a language option.
    * @param \Drupal\Core\Url $url
    *   The URL option to make the assertions on.
+   *
+   * @internal
    */
-  protected function assertUrl($expected_route_name, array $expected_route_parameters, $entity, $has_language, Url $url) {
+  protected function assertUrl(string $expected_route_name, array $expected_route_parameters, $entity, bool $has_language, Url $url): void {
     $this->assertEquals($expected_route_name, $url->getRouteName());
     $this->assertEquals($expected_route_parameters, $url->getRouteParameters());
     $this->assertEquals($this->entityTypeId, $url->getOption('entity_type'));
diff --git a/core/tests/Drupal/Tests/Core/File/FileSystemTest.php b/core/tests/Drupal/Tests/Core/File/FileSystemTest.php
index 465c60adb4f7..aa4ec558a8a1 100644
--- a/core/tests/Drupal/Tests/Core/File/FileSystemTest.php
+++ b/core/tests/Drupal/Tests/Core/File/FileSystemTest.php
@@ -138,8 +138,10 @@ public function providerTestBasename() {
    *   The URI to test.
    * @param string $message
    *   An optional error message.
+   *
+   * @internal
    */
-  protected function assertFilePermissions($expected_mode, $uri, $message = '') {
+  protected function assertFilePermissions(int $expected_mode, string $uri, string $message = ''): void {
     // Mask out all but the last three octets.
     $actual_mode = fileperms($uri) & 0777;
 
diff --git a/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php b/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php
index ee723020f64a..1f51ed6f40a5 100644
--- a/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php
@@ -51,6 +51,13 @@ class FormAjaxSubscriberTest extends UnitTestCase {
    */
   protected $messenger;
 
+  /**
+   * The event used to derive the response.
+   *
+   * @var \Symfony\Component\HttpKernel\Event\ExceptionEvent
+   */
+  protected $event = NULL;
+
   /**
    * {@inheritdoc}
    */
@@ -84,9 +91,9 @@ public function testOnException() {
       ->with($request, $expected_form, $form_state, $commands)
       ->willReturn($response);
 
-    $event = $this->assertResponseFromException($request, $exception, $response);
-    $this->assertTrue($event->isAllowingCustomResponseCode());
-    $this->assertSame(200, $event->getResponse()->getStatusCode());
+    $this->assertResponseFromException($request, $exception, $response);
+    $this->assertTrue($this->event->isAllowingCustomResponseCode());
+    $this->assertSame(200, $this->event->getResponse()->getStatusCode());
   }
 
   /**
@@ -109,9 +116,9 @@ public function testOnExceptionNewBuildId() {
       ->with($request, $expected_form, $form_state, $commands)
       ->willReturn($response);
 
-    $event = $this->assertResponseFromException($request, $exception, $response);
-    $this->assertTrue($event->isAllowingCustomResponseCode());
-    $this->assertSame(200, $event->getResponse()->getStatusCode());
+    $this->assertResponseFromException($request, $exception, $response);
+    $this->assertTrue($this->event->isAllowingCustomResponseCode());
+    $this->assertSame(200, $this->event->getResponse()->getStatusCode());
   }
 
   /**
@@ -146,8 +153,8 @@ public function testOnExceptionResponseBuilderException() {
       ->with($request, $expected_form, $form_state, $commands)
       ->willThrowException($expected_exception);
 
-    $event = $this->assertResponseFromException($request, $exception, NULL);
-    $this->assertSame($expected_exception, $event->getThrowable());
+    $this->assertResponseFromException($request, $exception, NULL);
+    $this->assertSame($expected_exception, $this->event->getThrowable());
   }
 
   /**
@@ -256,15 +263,13 @@ public function testOnExceptionNestedWrongException() {
    * @param \Symfony\Component\HttpFoundation\Response|null $expected_response
    *   The response expected to be set on the event.
    *
-   * @return \Symfony\Component\HttpKernel\Event\ExceptionEvent
-   *   The event used to derive the response.
+   * @internal
    */
-  protected function assertResponseFromException(Request $request, \Exception $exception, $expected_response) {
-    $event = new ExceptionEvent($this->httpKernel, $request, HttpKernelInterface::MASTER_REQUEST, $exception);
-    $this->subscriber->onException($event);
+  protected function assertResponseFromException(Request $request, \Exception $exception, ?Response $expected_response): void {
+    $this->event = new ExceptionEvent($this->httpKernel, $request, HttpKernelInterface::MASTER_REQUEST, $exception);
+    $this->subscriber->onException($this->event);
 
-    $this->assertSame($expected_response, $event->getResponse());
-    return $event;
+    $this->assertSame($expected_response, $this->event->getResponse());
   }
 
 }
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php b/core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php
index 39d4f5b5f870..7f9a23df2221 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php
@@ -89,8 +89,10 @@ protected function setUp(): void {
    *   The context definition to check.
    * @param mixed $value
    *   (optional) The value to set on the context, defaults to NULL.
+   *
+   * @internal
    */
-  protected function assertRequirementIsSatisfied($expected, ContextDefinition $requirement, ContextDefinition $definition, $value = NULL) {
+  protected function assertRequirementIsSatisfied(bool $expected, ContextDefinition $requirement, ContextDefinition $definition, $value = NULL): void {
     $context = new EntityContext($definition, $value);
     $this->assertSame($expected, $requirement->isSatisfiedBy($context));
   }
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
index a6626959fa5e..f9006bb3db5e 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
@@ -554,8 +554,10 @@ protected function generatePlaceholderElement() {
    *   rendered.
    * @param array $expected_data
    *   A render array with the expected values.
+   *
+   * @internal
    */
-  protected function assertPlaceholderRenderCache($cid_parts, array $bubbled_cache_contexts, array $expected_data) {
+  protected function assertPlaceholderRenderCache($cid_parts, array $bubbled_cache_contexts, array $expected_data): void {
     if ($cid_parts !== FALSE) {
       if ($bubbled_cache_contexts) {
         // Verify render cached placeholder.
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTest.php b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
index 8938dd44e641..ac69590e8bac 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
@@ -731,10 +731,12 @@ public function providerAccessValues() {
    *
    * @param array $build
    *   A render array with either #access or #access_callback.
-   * @param bool $access
+   * @param \Drupal\Core\Access\AccessResultInterface|bool $access
    *   Whether the render array is accessible or not.
+   *
+   * @internal
    */
-  protected function assertAccess($build, $access) {
+  protected function assertAccess(array $build, $access): void {
     $sensitive_content = $this->randomContextValue();
     $build['#markup'] = $sensitive_content;
     if (($access instanceof AccessResultInterface && $access->isAllowed()) || $access === TRUE) {
diff --git a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
index 108eb7f71649..bd3268d86d96 100644
--- a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
@@ -529,18 +529,20 @@ public function testGenerateWithPathProcessorChangingQueryParameter() {
   /**
    * Asserts \Drupal\Core\Routing\UrlGenerator::generateFromRoute()'s output.
    *
-   * @param $route_name
+   * @param string $route_name
    *   The route name to test.
    * @param array $route_parameters
    *   The route parameters to test.
    * @param array $options
    *   The options to test.
-   * @param $expected_url
+   * @param string $expected_url
    *   The expected generated URL string.
    * @param \Drupal\Core\Render\BubbleableMetadata $expected_bubbleable_metadata
    *   The expected generated bubbleable metadata.
+   *
+   * @internal
    */
-  protected function assertGenerateFromRoute($route_name, array $route_parameters, array $options, $expected_url, BubbleableMetadata $expected_bubbleable_metadata) {
+  protected function assertGenerateFromRoute(string $route_name, array $route_parameters, array $options, string $expected_url, BubbleableMetadata $expected_bubbleable_metadata): void {
     // First, test with $collect_cacheability_metadata set to the default value.
     $url = $this->generator->generateFromRoute($route_name, $route_parameters, $options);
     $this->assertSame($expected_url, $url);
diff --git a/core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php b/core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php
index 03450142e002..7cfc554cd3ec 100644
--- a/core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php
+++ b/core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php
@@ -357,8 +357,10 @@ public function errorHandler($errno, $errstr) {
    *   The error message.
    * @param int $errno
    *   The severity level of the error.
+   *
+   * @internal
    */
-  protected function assertError($errstr, $errno) {
+  protected function assertError(string $errstr, int $errno): void {
     foreach ($this->errors as $error) {
       if ($error['errstr'] === $errstr && $error['errno'] === $errno) {
         return;
diff --git a/core/tests/Drupal/Tests/Core/Template/AttributeTest.php b/core/tests/Drupal/Tests/Core/Template/AttributeTest.php
index b48b59668594..c05a4bfbe3ce 100644
--- a/core/tests/Drupal/Tests/Core/Template/AttributeTest.php
+++ b/core/tests/Drupal/Tests/Core/Template/AttributeTest.php
@@ -382,8 +382,10 @@ public function providerTestAttributeValues() {
    *   The CSS class to check.
    * @param string $html
    *   The HTML snippet to check.
+   *
+   * @internal
    */
-  protected function assertClass($class, $html) {
+  protected function assertClass(string $class, string $html): void {
     $xpath = "//*[@class='$class']";
     self::assertTrue((bool) $this->getXPathResultCount($xpath, $html));
   }
@@ -395,8 +397,10 @@ protected function assertClass($class, $html) {
    *   The CSS class to check.
    * @param string $html
    *   The HTML snippet to check.
+   *
+   * @internal
    */
-  protected function assertNoClass($class, $html) {
+  protected function assertNoClass(string $class, string $html): void {
     $xpath = "//*[@class='$class']";
     self::assertFalse((bool) $this->getXPathResultCount($xpath, $html));
   }
@@ -408,8 +412,10 @@ protected function assertNoClass($class, $html) {
    *   The CSS ID to check.
    * @param string $html
    *   The HTML snippet to check.
+   *
+   * @internal
    */
-  protected function assertID($id, $html) {
+  protected function assertID(string $id, string $html): void {
     $xpath = "//*[@id='$id']";
     self::assertTrue((bool) $this->getXPathResultCount($xpath, $html));
   }
@@ -421,8 +427,10 @@ protected function assertID($id, $html) {
    *   The CSS ID to check.
    * @param string $html
    *   The HTML snippet to check.
+   *
+   * @internal
    */
-  protected function assertNoID($id, $html) {
+  protected function assertNoID(string $id, string $html): void {
     $xpath = "//*[@id='$id']";
     self::assertFalse((bool) $this->getXPathResultCount($xpath, $html));
   }
diff --git a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
index cc466edd644a..540442693af8 100644
--- a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
@@ -650,8 +650,10 @@ public function testGenerateTwice() {
    *   The HTML to check.
    * @param int $count
    *   How many times the link should be present in the HTML. Defaults to 1.
+   *
+   * @internal
    */
-  public static function assertLink(array $properties, MarkupInterface $html, $count = 1) {
+  public static function assertLink(array $properties, MarkupInterface $html, int $count = 1): void {
     // Provide default values.
     $properties += ['attributes' => []];
 
@@ -686,10 +688,9 @@ public static function assertLink(array $properties, MarkupInterface $html, $cou
    * @param string $html
    *   The HTML snippet to check.
    *
-   * @return int
-   *   The number of results that are found.
+   * @internal
    */
-  protected function assertNoXPathResults($query, $html) {
+  protected function assertNoXPathResults(string $query, string $html): void {
     $document = new \DOMDocument();
     $document->loadHTML($html);
     $xpath = new \DOMXPath($document);
-- 
GitLab